Module: Accessorize::Base::InstanceMethods

Defined in:
lib/accessorize/base.rb

Instance Method Summary collapse

Instance Method Details

#after_findObject

This method is a performance killer and we are not expecting the base model to define it. If it is defined, this will replace it. In general if you want to define an additional after_find, call accessorize, then alias_method_chain the after_find.



34
35
36
# File 'lib/accessorize/base.rb', line 34

def after_find
  create_accessor('view')
end

#create_accessObject



18
19
20
# File 'lib/accessorize/base.rb', line 18

def create_access
  create_accessor('create')
end

#create_accessor(event) ⇒ Object



38
39
40
41
42
43
# File 'lib/accessorize/base.rb', line 38

def create_accessor(event)
  accessors.create(:event => event,
    :reference_type => self.class.name.tableize,
    :accessor_id => Accessorize::Extension.accessor,
    :meta => Accessorize::Extension.meta)
end

#destroy_accessObject



26
27
28
# File 'lib/accessorize/base.rb', line 26

def destroy_access
  create_accessor('destroy')
end

#update_accessObject



22
23
24
# File 'lib/accessorize/base.rb', line 22

def update_access
  create_accessor('update')
end