跳至内容 跳至搜索

当 Active Record 找到多条记录但只预期一条记录时引发。

方法
N

属性

[R] record

类公共方法

new(record = nil)

# File activerecord/lib/active_record/errors.rb, line 174
def initialize(record = nil)
  @record = record
  super "Wanted only one #{record&.name || "record"}"
end