From 676b703109338829d7da38ba887d81644c35025d Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 2 Dec 2014 01:44:11 +0300 Subject: [PATCH] #369: Fixed: missed variables at recreate action --- .../build_lists/new_build_list_controller.js.coffee | 3 ++- app/controllers/projects/build_lists_controller.rb | 3 ++- app/helpers/build_lists_helper.rb | 11 ++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/angular-new/build_lists/new_build_list_controller.js.coffee b/app/assets/javascripts/angular-new/build_lists/new_build_list_controller.js.coffee index f2ecfe8bf..451c3fd26 100644 --- a/app/assets/javascripts/angular-new/build_lists/new_build_list_controller.js.coffee +++ b/app/assets/javascripts/angular-new/build_lists/new_build_list_controller.js.coffee @@ -137,7 +137,8 @@ NewBuildListController = (dataservice, $http) -> false vm.addExtraBuildList = -> - vm.extra_build_lists = _.union(vm.extra_build_lists, [vm.selected_extra_build_list]) + if vm.selected_extra_build_list && vm.selected_extra_build_list.id + vm.extra_build_lists = _.union(vm.extra_build_lists, [vm.selected_extra_build_list]) vm.selected_extra_build_list = null false diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 6b775de96..fae8c0822 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -231,7 +231,8 @@ class Projects::BuildListsController < Projects::BaseController :save_to_repository_id, :auto_publish_status, :include_repos, :extra_params, :project_version, :update_type, :auto_create_container, :extra_repositories, :extra_build_lists, :build_for_platform_id, - :use_cached_chroot, :use_extra_tests, :save_buildroot + :use_cached_chroot, :use_extra_tests, :save_buildroot, + :include_testing_subrepository, :external_nodes ] keys.each { |key| params[:build_list][key] = build_list.send(key) } params[:arches] = [build_list.arch_id] diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index 375df005c..f50a0a971 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -207,7 +207,7 @@ module BuildListsHelper end def is_repository_checked(repo, params) - include_repos(params).include? repo.id + include_repos(params).include? repo.id.to_s end private @@ -244,18 +244,15 @@ module BuildListsHelper end def include_repos(params) - return @include_repos if @include_repos - @include_repos = params.try(:[], :build_list).try(:[], :include_repos) || [] + @include_repos ||= params.try(:[], :build_list).try(:[], :include_repos) || [] end def save_to_repository_id(params) - return @save_to_repository_id if @save_to_repository_id - @save_to_repository_id = params[:build_list].try(:[], :save_to_repository_id) + @save_to_repository_id ||= params[:build_list].try(:[], :save_to_repository_id).to_i end def project_version(project, params) - return @project_version if @project_version - @project_version = params[:build_list].try(:[], :project_version) || project.default_branch + @project_version ||= params[:build_list].try(:[], :project_version) || project.default_branch end def build_list_project_versions(project)