From 7cdd88a6ce3632c801223b33e5ccc2b9fc13651e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 4 Jul 2008 17:58:14 +0000 Subject: Merged Rails 2.1 compatibility branch. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1623 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user_preference.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/models/user_preference.rb') 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 -- cgit v1.2.3