diff options
Diffstat (limited to 'db/migrate')
3 files changed, 6 insertions, 6 deletions
diff --git a/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb index d8beb4aea..d7a9d5cc3 100644 --- a/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb +++ b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb @@ -2,9 +2,9 @@ class SupportForMultipleCommitKeywords < ActiveRecord::Migration[4.2] def up # Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings # with commit_update_keywords setting - keywords = Setting.where(:name => 'commit_fix_keywords').limit(1).pluck(:value).first - status_id = Setting.where(:name => 'commit_fix_status_id').limit(1).pluck(:value).first - done_ratio = Setting.where(:name => 'commit_fix_done_ratio').limit(1).pluck(:value).first + keywords = Setting.where(:name => 'commit_fix_keywords').pick(:value) + status_id = Setting.where(:name => 'commit_fix_status_id').pick(:value) + done_ratio = Setting.where(:name => 'commit_fix_done_ratio').pick(:value) if keywords.present? Setting.commit_update_keywords = [{'keywords' => keywords, 'status_id' => status_id, 'done_ratio' => done_ratio}] end diff --git a/db/migrate/20141029181752_add_trackers_default_status_id.rb b/db/migrate/20141029181752_add_trackers_default_status_id.rb index 74716ea63..043be0c68 100644 --- a/db/migrate/20141029181752_add_trackers_default_status_id.rb +++ b/db/migrate/20141029181752_add_trackers_default_status_id.rb @@ -2,8 +2,8 @@ class AddTrackersDefaultStatusId < ActiveRecord::Migration[4.2] def up add_column :trackers, :default_status_id, :integer - status_id = IssueStatus.where(:is_default => true).pluck(:id).first - status_id ||= IssueStatus.order(:position).pluck(:id).first + status_id = IssueStatus.where(:is_default => true).pick(:id) + status_id ||= IssueStatus.order(:position).pick(:id) if status_id Tracker.update_all :default_status_id => status_id end diff --git a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb index 09808e31c..94b518ea3 100644 --- a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb +++ b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb @@ -6,7 +6,7 @@ class RemoveIssueStatusesIsDefault < ActiveRecord::Migration[4.2] def down add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false # Restores the first status as default - default_status_id = IssueStatus.order(:position).pluck(:id).first + default_status_id = IssueStatus.order(:position).pick(:id) IssueStatus.where(:id => default_status_id).update_all(:is_default => true) end end |