Module | ActiveRecord::Locking::Optimistic::ClassMethods
In: | lib/active_record/locking/optimistic.rb

### Methods

extended locking_column locking_enabled? quoted_locking_column reset_locking_column set_locking_column update_counters_with_lock

### Constants

DEFAULT_LOCKING_COLUMN | = | 'lock_version'

### Public Class methods

extended(base)

### Public Instance methods

locking_column()

The version column used for optimistic locking. Defaults to `lock_version`.

locking_enabled?()

Is optimistic locking enabled for this table? 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`).

quoted_locking_column()

Quote the column name used for optimistic locking.

reset_locking_column()

Reset the column used for optimistic locking back to the `lock_version` default.

set_locking_column(value = nil, &block)

Set the column to use for optimistic locking. Defaults to `lock_version`.

update_counters_with_lock(id, counters)

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

[Validate]