Skip to content

Commit

Permalink
Change how the base module is included to prevent namespacing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
obrie committed Oct 4, 2008
1 parent cfff9f2 commit 24b5b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
== master

* Change how the base module is included to prevent namespacing conflicts

== 0.1.3 / 2008-06-29

* Add +prefs+ as an alias for +preferences+
Expand Down
8 changes: 1 addition & 7 deletions lib/preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ module PluginAWeek #:nodoc:
# u.attributes = {:prefers_notifications => true}
# u.save!
module Preferences
def self.included(base) #:nodoc:
base.class_eval do
extend PluginAWeek::Preferences::MacroMethods
end
end

module MacroMethods
# Defines a new preference for all records in the model. By default, preferences
# are assumed to have a boolean data type, so all values will be typecasted
Expand Down Expand Up @@ -286,5 +280,5 @@ def update_preferences
end

ActiveRecord::Base.class_eval do
include PluginAWeek::Preferences
extend PluginAWeek::Preferences::MacroMethods
end

0 comments on commit 24b5b61

Please sign in to comment.