Raised when Active Record finds multiple records but only expected one.

Methods

Attributes

[R] record

Class Public methods

new(record = nil)

📝 Source code
# File activerecord/lib/active_record/errors.rb, line 168
    def initialize(record = nil)
      @record = record
      super "Wanted only one #{record&.name || "record"}"
    end
🔎 See on GitHub