@@ -21,12 +21,14 class UserPreference < ActiveRecord::Base | |||||
21 |
|
21 | |||
22 | attr_protected :others |
|
22 | attr_protected :others | |
23 |
|
23 | |||
|
24 | before_save :set_others_hash | |||
|
25 | ||||
24 | def initialize(attributes = nil) |
|
26 | def initialize(attributes = nil) | |
25 | super |
|
27 | super | |
26 | self.others ||= {} |
|
28 | self.others ||= {} | |
27 | end |
|
29 | end | |
28 |
|
30 | |||
29 | def before_save |
|
31 | def set_others_hash | |
30 | self.others ||= {} |
|
32 | self.others ||= {} | |
31 | end |
|
33 | end | |
32 |
|
34 |
General Comments 0
You need to be logged in to leave comments.
Login now