Module: Hammock::RestfulSupport

Defined in:
lib/hammock/restful_support.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

Deps =
[Callbacks]

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/hammock/restful_support.rb', line 5

def self.included base # :nodoc:
  base.send :include, InstanceMethods
  base.send :extend, ClassMethods

  base.class_eval {
    before_modify :set_editing
    # TODO Investigate the usefulness of this.
    # before_destroy :set_editing
    before_create :set_creator_id_if_appropriate
    helper_method :mdl, :mdl_name, :editing?, :nested_within?, :partial_exists?
  }
end