Rails3: model: replace deprecated before_save method at UserPreference model

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8070 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-04 06:44:39 +00:00
parent 420e70180c
commit 32ed138c53
1 changed files with 3 additions and 1 deletions

View File

@ -21,12 +21,14 @@ class UserPreference < ActiveRecord::Base
attr_protected :others
before_save :set_others_hash
def initialize(attributes = nil)
super
self.others ||= {}
end
def before_save
def set_others_hash
self.others ||= {}
end