Skip to content

Commit

Permalink
Add note about human_attribute_name symbol/string
Browse files Browse the repository at this point in the history
This was always the intended API as per discussion in #36916, however versions before Rails 6 always passed a symbol. This means that some apps relied on symbols to be passed, this change is intended to note the change in behaviour so that apps can respond in kind.
  • Loading branch information
jules2689 authored and rafaelfranca committed Aug 15, 2019
1 parent e3b2a57 commit 5eaf39b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions activemodel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@

## Rails 6.0.0.beta1 (January 18, 2019) ##

* Internal calls to `human_attribute_name` on an `Active Model` now pass attributes as strings instead of symbols
in some cases.

This is in line with examples in Rails docs and puts the code in line with the intention -
the potential use of strings or symbols.

It is recommended to cast the attribute input to your desired type as if you you are overriding that methid.

*Martin Larochelle*

* Add `ActiveModel::Errors#of_kind?`.

*bogdanvlviv*, *Rafael Mendonça França*
Expand Down

0 comments on commit 5eaf39b

Please sign in to comment.