lib/resourcelogic/base.rb in binarylogic-resourcelogic-0.12.2 vs lib/resourcelogic/base.rb in binarylogic-resourcelogic-0.12.3

- old
+ new

@@ -6,13 +6,12 @@ include InstanceMethods end end module ClassMethods - def acts_as_resource(&block) + def acts_as_resource resourceful(true) - yield self if block_given? acts_as_resource_modules.each { |mod| include mod } init_default_actions end def init_default_actions @@ -41,16 +40,16 @@ flash { "#{model_name.to_s.singularize.humanize} successfully removed!" } wants.html { redirect_to collection_url } end end - # Since this part of Authlogic deals with another class, ActiveRecord, we can't just start including things - # in ActiveRecord itself. A lot of these module includes need to be triggered by the acts_as_authentic method - # call. For example, you don't want to start adding in email validations and what not into a model that has - # nothing to do with Authlogic. + # Since this part of Resourcelogic deals with another class, ActionController, we can't just start including things + # in ActionController itself. A lot of these module includes need to be triggered by the acts_as_resource method + # call. For example, you don't want to start adding in email validations and what not into a controller that has + # nothing to do with Resourcelogic. # - # That being said, this is your tool for extending Authlogic and "hooking" into the acts_as_authentic call. + # That being said, this is your tool for extending Resourcelogic and "hooking" into the acts_as_resource call. def add_acts_as_resource_module(mod, action = :append) modules = acts_as_resource_modules case action when :append modules << mod @@ -59,10 +58,10 @@ end modules.uniq! write_inheritable_attribute(:acts_as_resource_modules, modules) end - # This is the same as add_acts_as_authentic_module, except that it removes the module from the list. + # This is the same as add_acts_as_resource_module, except that it removes the module from the list. def remove_acts_as_resource_module(mod) write_inheritable_attribute(:acts_as_resource_modules, acts_as_resource_modules - [mod]) acts_as_resource_modules end \ No newline at end of file