update_counters(id, counters)
Instance Public methods
A generic âcounter updaterâ implementation,
intended primarily to be used by #increment_counter
and #decrement_counter,
but which may also be useful on its own. It simply does a direct SQL update
for the record with the given ID, altering the given hash of counters by
the amount given by the corresponding value:
Parameters
id - The id of the object you wish to update a counter on or
an Array of ids.
counters - A Hash containi