mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ff0204bc7f
- `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. |
||
---|---|---|
.. | ||
cases | ||
models | ||
validators |