Module: Accessorize::Base::InstanceMethods
- Defined in:
- lib/accessorize/base.rb
Instance Method Summary collapse
-
#after_find ⇒ Object
This method is a performance killer and we are not expecting the base model to define it.
- #create_access ⇒ Object
- #create_accessor(event) ⇒ Object
- #destroy_access ⇒ Object
- #update_access ⇒ Object
Instance Method Details
#after_find ⇒ Object
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_access ⇒ Object
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.) end |
#destroy_access ⇒ Object
26 27 28 |
# File 'lib/accessorize/base.rb', line 26 def destroy_access create_accessor('destroy') end |
#update_access ⇒ Object
22 23 24 |
# File 'lib/accessorize/base.rb', line 22 def update_access create_accessor('update') end |