1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test
Jahfer Husain 3650ca983c Add ActiveModel::Errors#merge!
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"] }
2017-07-07 14:32:59 -04:00
..
cases Add ActiveModel::Errors#merge! 2017-07-07 14:32:59 -04:00
models Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" 2017-07-02 02:15:17 +09:30
validators Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" 2017-07-02 02:15:17 +09:30