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