class method
self.new
Ruby on Rails 7.2.3
Since v3.2.22.5Signature
self.new(record = nil, attempted_action = nil)
No documentation comment.
Parameters
-
recordopt = nil -
attempted_actionopt = nil
Source
# File activerecord/lib/active_record/errors.rb, line 361
def initialize(record = nil, attempted_action = nil)
if record && attempted_action
@record = record
@attempted_action = attempted_action
super("Attempted to #{attempted_action} a stale object: #{record.class.name}.")
else
super("Stale object error.")
end
end
Defined in activerecord/lib/active_record/errors.rb line 361
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::StaleObjectError