Class: Attaching
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Attaching
- Defined in:
- lib/sga/attaching.rb
Instance Method Summary collapse
Instance Method Details
#after_create ⇒ Object
5 6 7 8 9 |
# File 'lib/sga/attaching.rb', line 5 def after_create if self.attachable.[:counter_cache] self.attachable.class.increment_counter(:assets_count, self.attachable.id) end end |
#after_destroy ⇒ Object
11 12 13 14 15 |
# File 'lib/sga/attaching.rb', line 11 def after_destroy if self.attachable.[:counter_cache] self.attachable.class.decrement_counter(:assets_count, self.attachable.id) end end |