From 425153b103fe64e5de554bb72dda09e2ce3cd426 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 4 Jul 2008 16:50:29 +0000 Subject: [PATCH] Rails 2.1 compatibility fix in UserPreference. git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1621 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- rails-2.1/app/models/user_preference.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rails-2.1/app/models/user_preference.rb b/rails-2.1/app/models/user_preference.rb index 73e4a50c6..3daa7a740 100644 --- a/rails-2.1/app/models/user_preference.rb +++ b/rails-2.1/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