Commit 6e9cc269a2a04fddb31eba10d95e0c9f9503eb1d

Authored by Rodrigo Souto
1 parent 1e9603c0

cache-counter: update counter straight on database skipping callbacks and validations

(ActionItem3039)
Showing 1 changed file with 1 additions and 2 deletions   Show diff stats
app/helpers/cache_counter_helper.rb
1 1 module CacheCounterHelper
2 2 def update_cache_counter(name, object, value)
3 3 if object.present?
4   - object.send(name.to_s+'=', object.send(name) + value)
5   - object.save!
  4 + object.class.update_counters(object.id, name => value)
6 5 end
7 6 end
8 7 end
... ...