Class: Counter::Cache::ActiveRecordUpdater
- Inherits:
-
Struct
- Object
- Struct
- Counter::Cache::ActiveRecordUpdater
- Defined in:
- lib/counter/cache/active_record_updater.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
3 4 5 |
# File 'lib/counter/cache/active_record_updater.rb', line 3 def @options end |
Instance Method Details
#after_create(record) ⇒ Object
4 5 6 |
# File 'lib/counter/cache/active_record_updater.rb', line 4 def after_create(record) counter_for(record).update(:incr) end |
#after_destroy(record) ⇒ Object
8 9 10 |
# File 'lib/counter/cache/active_record_updater.rb', line 8 def after_destroy(record) counter_for(record).update(:decr) end |