diff --git a/lib/preferences.rb b/lib/preferences.rb index 23ae075..7560adb 100644 --- a/lib/preferences.rb +++ b/lib/preferences.rb @@ -1,5 +1,5 @@ require 'preferences/preference_definition' - +require 'preferences/engine' # Adds support for defining preferences on ActiveRecord models. # # == Saving preferences @@ -152,7 +152,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' @@ -160,8 +160,8 @@ def preference(name, *args) after_save :update_preferences # Named scopes - named_scope :with_preferences, lambda {|preferences| build_preference_scope(preferences)} - named_scope :without_preferences, lambda {|preferences| build_preference_scope(preferences, true)} + scope :with_preferences, lambda {|preferences| build_preference_scope(preferences)} + scope :without_preferences, lambda {|preferences| build_preference_scope(preferences, true)} extend Preferences::ClassMethods include Preferences::InstanceMethods diff --git a/lib/preferences/engine.rb b/lib/preferences/engine.rb new file mode 100644 index 0000000..d0b9e08 --- /dev/null +++ b/lib/preferences/engine.rb @@ -0,0 +1,5 @@ +module Preferences + class Engine < Rails::Engine + + end +end \ No newline at end of file