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:
parent
420e70180c
commit
32ed138c53
|
@ -21,12 +21,14 @@ class UserPreference < ActiveRecord::Base
|
||||||
|
|
||||||
attr_protected :others
|
attr_protected :others
|
||||||
|
|
||||||
|
before_save :set_others_hash
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
def initialize(attributes = nil)
|
||||||
super
|
super
|
||||||
self.others ||= {}
|
self.others ||= {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def before_save
|
def set_others_hash
|
||||||
self.others ||= {}
|
self.others ||= {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue