Method: ActiveRecord::Locking::Optimistic::ClassMethods#locking_enabled?

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

#locking_enabled?Boolean

Returns true if the lock_optimistically flag is set to true (which it is, by default) and the table includes the locking_column column (defaults to lock_version).

Returns:

  • (Boolean)


128
129
130
# File 'lib/active_record/locking/optimistic.rb', line 128

def locking_enabled?
  lock_optimistically && columns_hash[locking_column]
end