Converted User#mail_notification from a boolean to a string.

The string will now store which type of notification option to use.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4216 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis committed 2010-09-28 18:22:00 +00:00
1 parent 3a3263102a
commit 0316af7f6b
9 files changed
+58 -24

No files matched your search

@@ -0,0 +1,9 @@
class ChangeUsersMailNotificationToString < ActiveRecord::Migration
def self.up
change_column :users, :mail_notification, :string, :default => '', :null => false
end
def self.down
change_column :users, :mail_notification, :boolean, :default => true, :null => false
end
end
@@ -0,0 +1,11 @@
# Patch the data from a boolean change.
class UpdateMailNotificationValues < ActiveRecord::Migration
def self.up
User.update_all("mail_notification = 'all'", "mail_notification = '1'")
User.update_all("mail_notification = 'only_my_events'", "mail_notification = '0'")
end
def self.down
# No-op
end
end