Methods
- C
- L
- Q
- R
- U
Constants
DEFAULT_LOCKING_COLUMN | = | 'lock_version' |
Instance Public methods
column_defaults()
Link
locking_column()
Link
The version column used for optimistic locking. Defaults to
lock_version
.
locking_column=(value)
Link
Set the column to use for optimistic locking. Defaults to
lock_version
.
locking_enabled?()
Link
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()
Link
Quote the column name used for optimistic locking.
# File activerecord/lib/active_record/locking/optimistic.rb, line 155 def quoted_locking_column ActiveSupport::Deprecation.warn "ActiveRecord::Base.quoted_locking_column is deprecated and will be removed in Rails 4.2 or later." connection.quote_column_name(locking_column) end
reset_locking_column()
Link
Reset the column used for optimistic locking back to the
lock_version
default.
update_counters(id, counters)
Link
Make sure the lock version column gets updated when counters are updated.