From be796902bb88df22d17a2b67162eb656cb75e3bb Mon Sep 17 00:00:00 2001 From: Richard Taylor Date: Wed, 7 Dec 2011 14:30:11 +0000 Subject: [PATCH 1/2] fixed deprecation warnings --- lib/preferences.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/preferences.rb b/lib/preferences.rb index 126080e..7a9e7e1 100644 --- a/lib/preferences.rb +++ b/lib/preferences.rb @@ -153,7 +153,7 @@ module MacroMethods # user.save! # => true def preference(name, *args) unless included_modules.include?(InstanceMethods) - class_inheritable_hash :preference_definitions + class_attribute :preference_definitions self.preference_definitions = {} has_many :stored_preferences, :as => :owner, :class_name => 'Preference', :dependent => :destroy From c058833c56b5a04d79fb9b3b71d28ea2f6557954 Mon Sep 17 00:00:00 2001 From: kareem mayan Date: Sun, 9 Sep 2012 18:33:57 -0700 Subject: [PATCH 2/2] make attributes attr_accessible Rails 3.0 makes everything protected by default. --- app/models/preference.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/preference.rb b/app/models/preference.rb index 8538721..fa53235 100644 --- a/app/models/preference.rb +++ b/app/models/preference.rb @@ -14,6 +14,8 @@ class Preference < ActiveRecord::Base validates_presence_of :name, :owner_id, :owner_type validates_presence_of :group_type, :if => :group_id? + attr_accessible :name, :group_id, :group_type + class << self # Splits the given group into its corresponding id and type. For simple # primitives, the id will be nil. For complex types, specifically