Commit 6e9cc269a2a04fddb31eba10d95e0c9f9503eb1d
1 parent
1e9603c0
Exists in
master
and in
29 other branches
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 | module CacheCounterHelper | 1 | module CacheCounterHelper |
2 | def update_cache_counter(name, object, value) | 2 | def update_cache_counter(name, object, value) |
3 | if object.present? | 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 | end | 5 | end |
7 | end | 6 | end |
8 | end | 7 | end |