Module: Kasket::WriteMixin::ClassMethods

Defined in:
lib/kasket/write_mixin.rb

Instance Method Summary collapse

Instance Method Details

#remove_from_kasket(ids) ⇒ Object



6
7
8
9
10
# File 'lib/kasket/write_mixin.rb', line 6

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) ⇒ Object



17
18
19
20
21
# File 'lib/kasket/write_mixin.rb', line 17

def transaction_with_kasket_disabled(*args)
  without_kasket do
    transaction_without_kasket_disabled(*args) { yield }
  end
end

#update_counters_with_kasket_clearing(*args) ⇒ Object



12
13
14
15
# File 'lib/kasket/write_mixin.rb', line 12

def update_counters_with_kasket_clearing(*args)
  remove_from_kasket(args[0])
  update_counters_without_kasket_clearing(*args)
end