class ActiveRecord::SoleRecordExceeded
Raised when Active Record finds multiple records but only expected one.
def initialize(record = nil)
def initialize(record = nil) @record = record super "Wanted only one #{record&.name || "record"}" end
Raised when Active Record finds multiple records but only expected one.
def initialize(record = nil) @record = record super "Wanted only one #{record&.name || "record"}" end