From f25a9887300eb35c513e2f6d9d74fbc36a8abab3 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 24 Dec 2012 17:17:21 +0400 Subject: [PATCH] #784: remove "build_requires" from BuildList --- app/models/build_list.rb | 4 ++-- app/models/project.rb | 1 - app/views/api/v1/build_lists/show.json.jbuilder | 2 +- app/views/projects/build_lists/new.html.haml | 3 --- app/views/projects/build_lists/show.html.haml | 3 --- config/locales/models/build_list.en.yml | 1 - config/locales/models/build_list.ru.yml | 1 - ...121224125838_remove_build_requires_from_build_list.rb | 9 +++++++++ spec/factories/build_lists.rb | 1 - 9 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 db/migrate/20121224125838_remove_build_requires_from_build_list.rb diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 981cde909..61fca1625 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -318,7 +318,7 @@ class BuildList < ActiveRecord::Base arch.name, (save_to_platform_id == build_for_platform_id ? '' : build_for_platform.name), update_type, - build_requires, + false, id, include_repos, priority, @@ -446,7 +446,7 @@ class BuildList < ActiveRecord::Base :git_project_address => project.git_project_address(user), # :commit_hash => 'fbb2549e44d97226fea6748a4f95d1d82ffb8726', :commit_hash => commit_hash, - :build_requires => build_requires, + :build_requires => false, :include_repos => include_repos_hash, :bplname => build_for_platform.name, :user => {:uname => user.uname, :email => user.email} diff --git a/app/models/project.rb b/app/models/project.rb index f1f96b338..cba45c60a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -143,7 +143,6 @@ class Project < ActiveRecord::Base bl.update_type = 'newpackage' bl.arch = arch bl.project_version = "latest_#{platform.name}" - bl.build_requires = false # already set as db default bl.user = user bl.auto_publish = auto_publish bl.include_repos = build_reps_ids diff --git a/app/views/api/v1/build_lists/show.json.jbuilder b/app/views/api/v1/build_lists/show.json.jbuilder index fc3600b6c..1d912f07b 100644 --- a/app/views/api/v1/build_lists/show.json.jbuilder +++ b/app/views/api/v1/build_lists/show.json.jbuilder @@ -1,6 +1,6 @@ json.build_list do |json| json.(@build_list, :id, :name, :container_path, :status, :duration) - json.(@build_list, :is_circle, :update_type, :build_requires, :priority) + json.(@build_list, :is_circle, :update_type, :priority) json.(@build_list, :advisory, :mass_build) json.(@build_list, :auto_publish, :package_version, :commit_hash, :last_published_commit_hash) json.build_log_url log_build_list_path(@build_list) diff --git a/app/views/projects/build_lists/new.html.haml b/app/views/projects/build_lists/new.html.haml index 86e077fa9..390685c19 100644 --- a/app/views/projects/build_lists/new.html.haml +++ b/app/views/projects/build_lists/new.html.haml @@ -26,9 +26,6 @@ .both = f.check_box :auto_publish = f.label :auto_publish - .both - = f.check_box :build_requires - = f.label :build_requires - if BuildList.has_access_to_new_core?(current_user) .both = f.check_box :new_core diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 74f70069b..8fa595f99 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -41,9 +41,6 @@ - else = @build_list.update_type .both - .leftlist= t("activerecord.attributes.build_list.build_requires") - .rightlist= t("layout.#{@build_list.build_requires}_") - .both .leftlist= t("activerecord.attributes.build_list.auto_publish") .rightlist= t("layout.#{@build_list.auto_publish}_") .both diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 7b8be15ba..7fd9af7e2 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -22,7 +22,6 @@ en: save_to_repository: Save to repository build_for_platform: Build for platform update_type: Update type - build_requires: Build with all the required packages auto_publish: Automated publising project_version: Version user: User diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index d4d5a5b32..81d2f8c9c 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -22,7 +22,6 @@ ru: save_to_repository: Сохранить в репозиторий build_for_platform: Собрано для платформы update_type: Критичность обновления - build_requires: Пересборка с зависимостями auto_publish: Автоматическая публикация project_version: Версия user: Пользователь diff --git a/db/migrate/20121224125838_remove_build_requires_from_build_list.rb b/db/migrate/20121224125838_remove_build_requires_from_build_list.rb new file mode 100644 index 000000000..bcfe3c6a1 --- /dev/null +++ b/db/migrate/20121224125838_remove_build_requires_from_build_list.rb @@ -0,0 +1,9 @@ +class RemoveBuildRequiresFromBuildList < ActiveRecord::Migration + def up + remove_column :build_lists, :build_requires + end + + def down + add_column :build_lists, :build_requires, :boolean, :default => false + end +end diff --git a/spec/factories/build_lists.rb b/spec/factories/build_lists.rb index ffbf1c26d..835869a7e 100644 --- a/spec/factories/build_lists.rb +++ b/spec/factories/build_lists.rb @@ -8,7 +8,6 @@ FactoryGirl.define do association :arch build_for_platform {|bl| bl.save_to_platform} save_to_repository {|bl| bl.save_to_platform.repositories.first} - build_requires true update_type 'security' include_repos {|bl| bl.save_to_platform.repositories.map(&:id)} project_version 'latest_master'