mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
3650ca983c
ActiveModel::Errors#merge! allows ActiveModel::Errors to append errors from a separate ActiveModel::Errors instance onto their own. Example: person = Person.new person.errors.add(:name, :blank) errors = ActiveModel::Errors.new(Person.new) errors.add(:name, :invalid) person.errors.merge!(errors) puts person.errors.messages # => { name: ["can't be blank", "is invalid"] } |
||
---|---|---|
.. | ||
cases | ||
models | ||
validators |