CHANGELOG.md 1.2 KB
Newer Older
1 2
*   Allows configurable attribute name for `#has_secure_password`. This
    still defaults to an attribute named 'password', causing no breaking
3
    change. There is a new method `#authenticate_XXX` where XXX is the
4
    configured attribute name, making the existing `#authenticate` now an
5
    alias for this when the attribute is the default 'password'.
6
    Example:
7

8 9 10
        class User < ActiveRecord::Base
            has_secure_password :activation_token, validations: false
        end
11

12
        user = User.new()
13 14 15
        user.activation_token = "a_new_token"
        user.activation_token_digest                        # => "$2a$10$0Budk0Fi/k2CDm2PEwa3Be..."
        user.authenticate_activation_token('a_new_token')   # => user
16

17
     *Unathi Chonco*
18

B
bogdanvlviv 已提交
19 20 21 22 23 24
*   Add `config.active_model.i18n_full_message` in order to control whether
    the `full_message` error format can be overridden at the attribute or model
    level in the locale files. This is `false` by default.

    *Martin Larochelle*

J
Jeremy Daer 已提交
25 26 27
*   Rails 6 requires Ruby 2.4.1 or newer.

    *Jeremy Daer*
28 29


30
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activemodel/CHANGELOG.md) for previous changes.