@@ -1,17 +1,17 | |||||
1 | class SupportForMultipleCommitKeywords < ActiveRecord::Migration |
|
1 | class SupportForMultipleCommitKeywords < ActiveRecord::Migration | |
2 | def up |
|
2 | def up | |
3 | # Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings |
|
3 | # Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings | |
4 | # with commit_update_keywords setting |
|
4 | # with commit_update_keywords setting | |
5 | keywords = Setting.where(:name => 'commit_fix_keywords').limit(1).pluck(:value).first |
|
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 |
|
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 |
|
7 | done_ratio = Setting.where(:name => 'commit_fix_done_ratio').limit(1).pluck(:value).first | |
8 | if keywords.present? |
|
8 | if keywords.present? | |
9 |
Setting.commit_update_keywords = {keywords => |
|
9 | Setting.commit_update_keywords = [{'keywords' => keywords, 'status_id' => status_id, 'done_ratio' => done_ratio}] | |
10 | end |
|
10 | end | |
11 | Setting.where(:name => %w(commit_fix_keywords commit_fix_status_id commit_fix_done_ratio)).delete_all |
|
11 | Setting.where(:name => %w(commit_fix_keywords commit_fix_status_id commit_fix_done_ratio)).delete_all | |
12 | end |
|
12 | end | |
13 |
|
13 | |||
14 | def down |
|
14 | def down | |
15 | Setting.where(:name => 'commit_update_keywords').delete_all |
|
15 | Setting.where(:name => 'commit_update_keywords').delete_all | |
16 | end |
|
16 | end | |
17 | end |
|
17 | end |
General Comments 0
You need to be logged in to leave comments.
Login now