summaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-05 09:41:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-05 09:41:11 +0000
commita77b462a53a02dbead1042bd12060177ade7b22a (patch)
tree4d58c8dee5c021a8dd1af32a8fbe741e3c6ea1d0 /db/migrate
parentb59d10968036b7da57a499895a9a2d91ea227c34 (diff)
downloadredmine-a77b462a53a02dbead1042bd12060177ade7b22a.tar.gz
redmine-a77b462a53a02dbead1042bd12060177ade7b22a.zip
Support for multiple issue update keywords/rules in commit messages (#4911).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12197 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20131004113137_support_for_multiple_commit_keywords.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
new file mode 100644
index 000000000..77989d9f3
--- /dev/null
+++ b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
@@ -0,0 +1,17 @@
+class SupportForMultipleCommitKeywords < ActiveRecord::Migration
+ 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
+ if keywords.present?
+ Setting.commit_update_keywords = {keywords => {'status_id' => status_id, 'done_ratio' => done_ratio}}
+ end
+ Setting.where(:name => %w(commit_fix_keywords commit_fix_status_id commit_fix_done_ratio)).delete_all
+ end
+
+ def down
+ Setting.where(:name => 'commit_update_keywords').delete_all
+ end
+end