Raised on attempt to save stale record. Record is stale when it’s being saved in another query after instantiation, for example, when two users edit the same wiki page and one starts editing and saves the page before the other.

Read more about optimistic locking in ActiveRecord::Locking module RDoc.

Methods
M
N
Attributes
[R] attempted_action
[R] record
Class Public methods
new(record, attempted_action)
# File activerecord/lib/active_record/errors.rb, line 104
def initialize(record, attempted_action)
  @record = record
  @attempted_action = attempted_action
end
Instance Public methods
message()
# File activerecord/lib/active_record/errors.rb, line 109
def message
  "Attempted to #{attempted_action} a stale object: #{record.class.name}"
end