Project

General

Profile

Patch #32909 » pick2.patch

Pavel Rosický, 2020-01-28 23:06

View differences:

20131004113137_support_for_multiple_commit_keywords.rb (working copy)
2 2
  def up
3 3
    # Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings
4 4
    # with commit_update_keywords setting
5
    keywords = Setting.where(:name => 'commit_fix_keywords').limit(1).pluck(:value).first
6
    status_id = Setting.where(:name => 'commit_fix_status_id').limit(1).pluck(:value).first
7
    done_ratio = Setting.where(:name => 'commit_fix_done_ratio').limit(1).pluck(:value).first
5
    keywords = Setting.where(:name => 'commit_fix_keywords').pick(:value)
6
    status_id = Setting.where(:name => 'commit_fix_status_id').pick(:value)
7
    done_ratio = Setting.where(:name => 'commit_fix_done_ratio').pick(:value)
8 8
    if keywords.present?
9 9
      Setting.commit_update_keywords = [{'keywords' => keywords, 'status_id' => status_id, 'done_ratio' => done_ratio}]
10 10
    end
20141029181752_add_trackers_default_status_id.rb (working copy)
2 2
  def up
3 3
    add_column :trackers, :default_status_id, :integer
4 4

  
5
    status_id = IssueStatus.where(:is_default => true).pluck(:id).first
6
    status_id ||= IssueStatus.order(:position).pluck(:id).first
5
    status_id = IssueStatus.where(:is_default => true).pick(:id)
6
    status_id ||= IssueStatus.order(:position).pick(:id)
7 7
    if status_id
8 8
      Tracker.update_all :default_status_id => status_id
9 9
    end
20141029181824_remove_issue_statuses_is_default.rb (working copy)
6 6
  def down
7 7
    add_column :issue_statuses, :is_default, :boolean, :null => false, :default => false
8 8
    # Restores the first status as default
9
    default_status_id = IssueStatus.order(:position).pluck(:id).first
9
    default_status_id = IssueStatus.order(:position).pick(:id)
10 10
    IssueStatus.where(:id => default_status_id).update_all(:is_default => true)
11 11
  end
12 12
end
(2-2/3)