CHANGELOG.md 2.0 KB
Newer Older
1 2
## Rails 6.0.0.beta1 (January 18, 2019) ##

B
bogdanvlviv 已提交
3 4 5 6
*   Add `ActiveModel::Errors#of_kind?`.

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

7 8 9 10 11
*   Fix numericality equality validation of `BigDecimal` and `Float`
    by casting to `BigDecimal` on both ends of the validation.

    *Gannon McGibbon*

12 13 14 15
*   Add `#slice!` method to `ActiveModel::Errors`.

    *Daniel López Prat*

16 17 18 19 20 21
*   Fix numericality validator to still use value before type cast except Active Record.

    Fixes #33651, #33686.

    *Ryuta Kamizono*

22 23
*   Fix `ActiveModel::Serializers::JSON#as_json` method for timestamps.

R
Ryuta Kamizono 已提交
24 25 26 27 28 29 30 31 32 33 34
    Before:
    ```
    contact = Contact.new(created_at: Time.utc(2006, 8, 1))
    contact.as_json["created_at"] # => 2006-08-01 00:00:00 UTC
    ```

    After:
    ```
    contact = Contact.new(created_at: Time.utc(2006, 8, 1))
    contact.as_json["created_at"] # => "2006-08-01T00:00:00.000Z"
    ```
35 36 37

    *Bogdan Gusiev*

38 39
*   Allows configurable attribute name for `#has_secure_password`. This
    still defaults to an attribute named 'password', causing no breaking
40
    change. There is a new method `#authenticate_XXX` where XXX is the
41
    configured attribute name, making the existing `#authenticate` now an
42
    alias for this when the attribute is the default 'password'.
R
Ryuta Kamizono 已提交
43

44
    Example:
45

46
        class User < ActiveRecord::Base
47
          has_secure_password :recovery_password, validations: false
48
        end
49

50
        user = User.new()
51 52 53
        user.recovery_password = "42password"
        user.recovery_password_digest # => "$2a$04$iOfhwahFymCs5weB3BNH/uX..."
        user.authenticate_recovery_password('42password') # => user
54

R
Ryuta Kamizono 已提交
55
    *Unathi Chonco*
56

B
bogdanvlviv 已提交
57 58 59 60 61 62
*   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*

K
Kasper Timm Hansen 已提交
63
*   Rails 6 requires Ruby 2.5.0 or newer.
J
Jeremy Daer 已提交
64

K
Kasper Timm Hansen 已提交
65
    *Jeremy Daer*, *Kasper Timm Hansen*
66 67


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