summaryrefslogtreecommitdiffstats
path: root/app/models/user_preference.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user_preference.rb')
-rw-r--r--app/models/user_preference.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index 73e4a50c6..3daa7a740 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -42,8 +42,10 @@ class UserPreference < ActiveRecord::Base
if attribute_present? attr_name
super
else
- self.others ||= {}
- self.others.store attr_name, value
+ h = read_attribute(:others).dup || {}
+ h.update(attr_name => value)
+ write_attribute(:others, h)
+ value
end
end