module Sequel::Plugins::OptimisticLockingBase::ClassMethods
Attributes
lock_column[RW]
The column holding the version of the lock
Private Instance Methods
prevent_lock_column_increase!()
click to toggle source
Prevent increasing the value of the lock column. If the lock column has an existing value, do not allow setting a value that is higher than it.
Calls superclass method
# File lib/sequel/plugins/optimistic_locking_base.rb 21 def prevent_lock_column_increase! 22 lc = lock_column 23 define_method(:"#{lc}=") do |v| 24 unless v && (lv = send(lc)) && v > lv 25 super(v) 26 end 27 end 28 end