summaryrefslogtreecommitdiffstats
path: root/db/migrate/20091010093521_fix_users_custom_values.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 10:16:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 10:16:00 +0000
commit6656d41a413a91a32f41e0f973c3f9db07cf9c93 (patch)
treefc1cd37b0e2801c6259c8e46eded594bf26890ef /db/migrate/20091010093521_fix_users_custom_values.rb
parentbcbf08017a5f038a61b4af693042bec9f1100953 (diff)
downloadredmine-6656d41a413a91a32f41e0f973c3f9db07cf9c93.tar.gz
redmine-6656d41a413a91a32f41e0f973c3f9db07cf9c93.zip
Fixes User/CustomValue association broken by r2869 (#3978).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2905 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/20091010093521_fix_users_custom_values.rb')
-rw-r--r--db/migrate/20091010093521_fix_users_custom_values.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20091010093521_fix_users_custom_values.rb b/db/migrate/20091010093521_fix_users_custom_values.rb
new file mode 100644
index 000000000..923c78fc0
--- /dev/null
+++ b/db/migrate/20091010093521_fix_users_custom_values.rb
@@ -0,0 +1,9 @@
+class FixUsersCustomValues < ActiveRecord::Migration
+ def self.up
+ CustomValue.update_all("customized_type = 'Principal'", "customized_type = 'User'")
+ end
+
+ def self.down
+ CustomValue.update_all("customized_type = 'User'", "customized_type = 'Principal'")
+ end
+end