Method: ActiveRecord::Locking::Optimistic::ClassMethods#update_counters

Defined in:
lib/active_record/locking/optimistic.rb

#update_counters(id, counters) ⇒ Object

Make sure the lock version column gets updated when counters are updated.



164
165
166
167
# File 'lib/active_record/locking/optimistic.rb', line 164

def update_counters(id, counters)
  counters = counters.merge(locking_column => 1) if locking_enabled?
  super
end