当 Active Record 找到多条记录但只预期一条记录时引发。
方法
- N
属性
[R] | record |
类公共方法
new(record = nil) 链接
源代码:显示 | 在 GitHub 上
# File activerecord/lib/active_record/errors.rb, line 174 def initialize(record = nil) @record = record super "Wanted only one #{record&.name || "record"}" end