Module: Kasket::WriteMixin::ClassMethods
- Defined in:
- lib/kasket/write_mixin.rb
Instance Method Summary collapse
- #remove_from_kasket(ids) ⇒ Object
- #transaction_with_kasket_disabled(*args, **kwargs) ⇒ Object
- #update_counters_with_kasket_clearing(*args, **kwargs) ⇒ Object
Instance Method Details
#remove_from_kasket(ids) ⇒ Object
5 6 7 8 9 |
# File 'lib/kasket/write_mixin.rb', line 5 def remove_from_kasket(ids) Array(ids).each do |id| Kasket.cache.delete(kasket_key_for_id(id)) end end |
#transaction_with_kasket_disabled(*args, **kwargs) ⇒ Object
16 17 18 19 20 |
# File 'lib/kasket/write_mixin.rb', line 16 def transaction_with_kasket_disabled(*args, **kwargs) without_kasket do transaction_without_kasket_disabled(*args, **kwargs) { yield } end end |
#update_counters_with_kasket_clearing(*args, **kwargs) ⇒ Object
11 12 13 14 |
# File 'lib/kasket/write_mixin.rb', line 11 def update_counters_with_kasket_clearing(*args, **kwargs) remove_from_kasket(args[0]) update_counters_without_kasket_clearing(*args, **kwargs) end |