lib/cockpit/cockpit.rb in cockpit-0.0.1.5 vs lib/cockpit/cockpit.rb in cockpit-0.0.1.7
- old
+ new
@@ -3,11 +3,16 @@
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
- def acts_as_configurable(*args, &block)
+ # can be "unique_by_key"
+ # settings :text do
+ # ...
+ # settings :social do
+ # ...
+ def acts_as_configurable(*args, &block)
options = args.extract_options!
settings_name = (args.shift || "settings").to_s
clazz_name = self.to_s.downcase.split("::").last
class_inheritable_accessor settings_name
@@ -32,9 +37,11 @@
# requires refactoring the Settings module
# so none of it uses class methods...
end
end
+ alias configurable acts_as_configurable
+ alias settings acts_as_configurable
def acts_as_settable
belongs_to :configurable, :polymorphic => true
end
end
\ No newline at end of file