You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20131004113137_support_for_multiple_commit_keywords.rb 789B

1234567891011121314151617
  1. class SupportForMultipleCommitKeywords < ActiveRecord::Migration[4.2]
  2. def up
  3. # Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings
  4. # with commit_update_keywords setting
  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. if keywords.present?
  9. Setting.commit_update_keywords = [{'keywords' => keywords, 'status_id' => status_id, 'done_ratio' => done_ratio}]
  10. end
  11. Setting.where(:name => %w(commit_fix_keywords commit_fix_status_id commit_fix_done_ratio)).delete_all
  12. end
  13. def down
  14. Setting.where(:name => 'commit_update_keywords').delete_all
  15. end
  16. end