#472: Update Platforms::MassBuildsController

This commit is contained in:
Vokhmin Alexey V 2015-05-21 00:27:16 +03:00
parent 161a249c82
commit d50ad4a157
3 changed files with 24 additions and 5 deletions

View File

@ -22,7 +22,7 @@ class Platforms::MassBuildsController < Platforms::BaseController
end
def create
@mass_build = @platform.mass_builds.build(params[:mass_build])
@mass_build = @platform.mass_builds.build(subject_params(MassBuild))
@mass_build.user = current_user
@mass_build.arches = params[:arches] || []
@mass_build.repositories ||= params[:repositories] || []

View File

@ -45,10 +45,6 @@ class MassBuild < ActiveRecord::Base
scope :search, -> (q) { where("#{table_name}.description ILIKE ?", "%#{q}%") if q.present? }
attr_accessor :arches, :repositories
# attr_accessible :arches, :auto_publish_status, :projects_list, :build_for_platform_id,
# :extra_repositories, :extra_build_lists, :increase_release_tag,
# :use_cached_chroot, :use_extra_tests, :description, :extra_mass_builds,
# :include_testing_subrepository, :auto_create_container, :repositories
validates :save_to_platform_id,
:build_for_platform_id,

View File

@ -15,4 +15,27 @@ class MassBuildPolicy < ApplicationPolicy
!record.stop_build && create?
end
# Public: Get list of parameters that the user is allowed to alter.
#
# Returns Array
def permitted_attributes
%i(
arches
auto_create_container
auto_publish_status
build_for_platform_id
description
external_nodes
extra_build_lists
extra_mass_builds
extra_repositories
include_testing_subrepository
increase_release_tag
projects_list
repositories
use_cached_chroot
use_extra_tests
)
end
end