module Sequel::Plugins::OptimisticLocking::InstanceMethods

Private Instance Methods

_update_columns(columns) click to toggle source

Only update the row if it has the same lock version, and increment the lock version.

Calls superclass method
   # File lib/sequel/plugins/optimistic_locking.rb
42 def _update_columns(columns)
43   lc = model.lock_column
44   lcv = get_column_value(lc)
45   columns[lc] = lcv + 1
46   super
47   set_column_value("#{lc}=", lcv + 1)
48   changed_columns.delete(lc)
49   nil
50 end