class ActiveRecord::SoleRecordExceeded
Raised when Active Record finds multiple records but only expected one.
Inherits From
Attributes
[R] | record |
Public class methods
Source code GitHub
# File activerecord/lib/active_record/errors.rb, line 166
def initialize(record = nil)
@record = record
super "Wanted only one #{record&.name || "record"}"
end