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
Edouard CHIN ff0204bc7f Modify behaviour of AM::Errors#to_h:
- `AM::Error#to_h` was kind of broken before and would return in the
  hash values a single error message.

  ```ruby
    person = Person.new
    person.errors.add(:name, "cannot be blank")
    person.errors.add(:name, "too long")

    puts person.errors.to_h # {name: 'too long'}
  ```

  Since an attribute can have different errors, the previous behavior
  didn't make much sense.

  Now, `ActiveModel::Errors#to_hash` correctly returns an array of
  error messages containing all the errors for an attribute.
  However, one can easily be surprised by this change, so let's
  deprecated it first.
2019-07-23 17:58:59 +02:00
..
cases Modify behaviour of AM::Errors#to_h: 2019-07-23 17:58:59 +02:00
models Merge pull request #32313 from lulalala/model_error_as_object 2019-04-24 16:16:00 -04:00
validators Raise deprecation for calling [:f] = 'b' or [:f] << 'b' 2019-03-31 22:59:12 +08:00