CHANGELOG.md 5.3 KB
Newer Older
G
George Claghorn 已提交
1 2 3 4 5
## Rails 6.0.3.3 (September 09, 2020) ##

*   No changes.


A
Aaron Patterson 已提交
6 7 8 9 10
## Rails 6.0.3.2 (June 17, 2020) ##

*   No changes.


11 12 13 14 15
## Rails 6.0.3.1 (May 18, 2020) ##

*   No changes.


16
## Rails 6.0.3 (May 06, 2020) ##
17 18 19 20

*   No changes.


21 22 23 24 25
## Rails 6.0.2.2 (March 19, 2020) ##

*   No changes.


26 27 28 29 30
## Rails 6.0.2.1 (December 18, 2019) ##

*   No changes.


31
## Rails 6.0.2 (December 13, 2019) ##
32 33 34 35

*   No changes.


G
v6.0.1  
George Claghorn 已提交
36
## Rails 6.0.1 (November 5, 2019) ##
G
George Claghorn 已提交
37 38 39 40

*   No changes.


41 42 43 44 45
## Rails 6.0.0 (August 16, 2019) ##

*   No changes.


46 47 48 49 50
## Rails 6.0.0.rc2 (July 22, 2019) ##

*   No changes.


51 52
## Rails 6.0.0.rc1 (April 24, 2019) ##

53 54 55 56 57 58
*   Type cast falsy boolean symbols on boolean attribute as false.

    Fixes #35676.

    *Ryuta Kamizono*

59
*   Change how validation error translation strings are fetched: The new behavior
60 61
    will first try the more specific keys, including doing locale fallback, then try
    the less specific ones.
E
eileencodes 已提交
62

63 64
    For example, this is the order in which keys will now be tried for a `blank`
    error on a `product`'s `title` attribute with current locale set to `en-US`:
E
eileencodes 已提交
65

66 67 68
        en-US.activerecord.errors.models.product.attributes.title.blank
        en-US.activerecord.errors.models.product.blank
        en-US.activerecord.errors.messages.blank
E
eileencodes 已提交
69

70 71 72
        en.activerecord.errors.models.product.attributes.title.blank
        en.activerecord.errors.models.product.blank
        en.activerecord.errors.messages.blank
E
eileencodes 已提交
73

74 75
        en-US.errors.attributes.title.blank
        en-US.errors.messages.blank
E
eileencodes 已提交
76

77 78
        en.errors.attributes.title.blank
        en.errors.messages.blank
E
eileencodes 已提交
79

80 81
    *Hugo Vacher*

E
eileencodes 已提交
82

E
eileencodes 已提交
83 84 85 86 87
## Rails 6.0.0.beta3 (March 11, 2019) ##

*   No changes.


88 89
## Rails 6.0.0.beta2 (February 25, 2019) ##

90 91
*   Fix date value when casting a multiparameter date hash to not convert
    from Gregorian date to Julian date.
92 93 94 95

    Before:

        Day.new({"day(1i)"=>"1", "day(2i)"=>"1", "day(3i)"=>"1"})
96
        # => #<Day id: nil, day: "0001-01-03", created_at: nil, updated_at: nil>
97 98 99 100

    After:

        Day.new({"day(1i)"=>"1", "day(2i)"=>"1", "day(3i)"=>"1"})
101
        # => #<Day id: nil, day: "0001-01-01", created_at: nil, updated_at: nil>
102

103
    Fixes #28521.
104 105

    *Sayan Chakraborty*
106

107
*   Fix year value when casting a multiparameter time hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

    When assigning a hash to a time attribute that's missing a year component
    (e.g. a `time_select` with `:ignore_date` set to `true`) then the year
    defaults to 1970 instead of the expected 2000. This results in the attribute
    changing as a result of the save.

    Before:
    ```
    event = Event.new(start_time: { 4 => 20, 5 => 30 })
    event.start_time # => 1970-01-01 20:30:00 UTC
    event.save
    event.reload
    event.start_time # => 2000-01-01 20:30:00 UTC
    ```

    After:
    ```
    event = Event.new(start_time: { 4 => 20, 5 => 30 })
    event.start_time # => 2000-01-01 20:30:00 UTC
    event.save
    event.reload
    event.start_time # => 2000-01-01 20:30:00 UTC
    ```

    *Andrew White*


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

137 138 139 140 141 142 143 144 145 146
*   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*

B
bogdanvlviv 已提交
147 148 149 150
*   Add `ActiveModel::Errors#of_kind?`.

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

151 152 153 154 155
*   Fix numericality equality validation of `BigDecimal` and `Float`
    by casting to `BigDecimal` on both ends of the validation.

    *Gannon McGibbon*

156 157 158 159
*   Add `#slice!` method to `ActiveModel::Errors`.

    *Daniel López Prat*

160 161 162 163 164 165
*   Fix numericality validator to still use value before type cast except Active Record.

    Fixes #33651, #33686.

    *Ryuta Kamizono*

166 167
*   Fix `ActiveModel::Serializers::JSON#as_json` method for timestamps.

R
Ryuta Kamizono 已提交
168 169 170 171 172 173 174 175 176 177 178
    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"
    ```
179 180 181

    *Bogdan Gusiev*

182 183
*   Allows configurable attribute name for `#has_secure_password`. This
    still defaults to an attribute named 'password', causing no breaking
184
    change. There is a new method `#authenticate_XXX` where XXX is the
185
    configured attribute name, making the existing `#authenticate` now an
186
    alias for this when the attribute is the default 'password'.
R
Ryuta Kamizono 已提交
187

188
    Example:
189

190
        class User < ActiveRecord::Base
191
          has_secure_password :recovery_password, validations: false
192
        end
193

194
        user = User.new()
195 196 197
        user.recovery_password = "42password"
        user.recovery_password_digest # => "$2a$04$iOfhwahFymCs5weB3BNH/uX..."
        user.authenticate_recovery_password('42password') # => user
198

R
Ryuta Kamizono 已提交
199
    *Unathi Chonco*
200

201
*   Add `config.active_model.i18n_customize_full_message` in order to control whether
B
bogdanvlviv 已提交
202 203 204 205 206
    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 已提交
207
*   Rails 6 requires Ruby 2.5.0 or newer.
J
Jeremy Daer 已提交
208

K
Kasper Timm Hansen 已提交
209
    *Jeremy Daer*, *Kasper Timm Hansen*
210 211


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