- Inheritance
Constants
Name | Description | |
---|---|---|
DEFAULT_LOCKING_COLUMN | = 'lock_version' |
Methods
Class
Visibility | Signature |
---|---|
public | extended (base) |
Instance
Visibility | Signature |
---|---|
public | locking_column () |
public | locking_enabled? () |
public | quoted_locking_column () |
public | reset_locking_column () |
public | set_locking_column (value = nil, &block) |
public | update_counters_with_lock (id, counters) |
Class Method Detail
extended(base)
Instance Method Detail
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.