2019-01-04 13:35:17 -05:00
|
|
|
* Add `ActiveModel::Errors#of_kind?`.
|
|
|
|
|
|
|
|
*bogdanvlviv*, *Rafael Mendonça França*
|
|
|
|
|
2017-07-07 18:31:22 -04:00
|
|
|
* Fix numericality equality validation of `BigDecimal` and `Float`
|
|
|
|
by casting to `BigDecimal` on both ends of the validation.
|
|
|
|
|
|
|
|
*Gannon McGibbon*
|
|
|
|
|
2018-11-20 18:54:22 -05:00
|
|
|
* Add `#slice!` method to `ActiveModel::Errors`.
|
|
|
|
|
|
|
|
*Daniel López Prat*
|
|
|
|
|
2018-08-19 01:57:05 -04:00
|
|
|
* Fix numericality validator to still use value before type cast except Active Record.
|
|
|
|
|
|
|
|
Fixes #33651, #33686.
|
|
|
|
|
|
|
|
*Ryuta Kamizono*
|
|
|
|
|
2018-08-12 08:38:47 -04:00
|
|
|
* Fix `ActiveModel::Serializers::JSON#as_json` method for timestamps.
|
|
|
|
|
2018-09-06 18:56:31 -04:00
|
|
|
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"
|
|
|
|
```
|
2018-08-12 08:38:47 -04:00
|
|
|
|
|
|
|
*Bogdan Gusiev*
|
|
|
|
|
2016-10-11 13:01:01 -04:00
|
|
|
* Allows configurable attribute name for `#has_secure_password`. This
|
|
|
|
still defaults to an attribute named 'password', causing no breaking
|
2018-06-28 07:01:21 -04:00
|
|
|
change. There is a new method `#authenticate_XXX` where XXX is the
|
2016-10-11 21:01:57 -04:00
|
|
|
configured attribute name, making the existing `#authenticate` now an
|
2018-06-28 07:01:21 -04:00
|
|
|
alias for this when the attribute is the default 'password'.
|
2018-09-06 18:56:31 -04:00
|
|
|
|
2016-10-11 21:01:57 -04:00
|
|
|
Example:
|
2018-06-28 07:01:21 -04:00
|
|
|
|
2016-10-11 13:01:01 -04:00
|
|
|
class User < ActiveRecord::Base
|
2018-07-08 06:56:07 -04:00
|
|
|
has_secure_password :recovery_password, validations: false
|
2016-10-11 13:01:01 -04:00
|
|
|
end
|
2018-06-28 07:01:21 -04:00
|
|
|
|
2016-10-11 13:01:01 -04:00
|
|
|
user = User.new()
|
2018-07-08 06:56:07 -04:00
|
|
|
user.recovery_password = "42password"
|
|
|
|
user.recovery_password_digest # => "$2a$04$iOfhwahFymCs5weB3BNH/uX..."
|
|
|
|
user.authenticate_recovery_password('42password') # => user
|
2016-10-11 13:01:01 -04:00
|
|
|
|
2018-09-06 18:56:31 -04:00
|
|
|
*Unathi Chonco*
|
2016-10-10 19:29:24 -04:00
|
|
|
|
2018-06-11 18:21:15 -04:00
|
|
|
* 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*
|
|
|
|
|
2018-12-19 15:09:34 -05:00
|
|
|
* Rails 6 requires Ruby 2.5.0 or newer.
|
2018-02-17 16:02:18 -05:00
|
|
|
|
2018-12-19 15:09:34 -05:00
|
|
|
*Jeremy Daer*, *Kasper Timm Hansen*
|
2018-01-23 16:08:46 -05:00
|
|
|
|
|
|
|
|
2018-01-30 18:51:17 -05:00
|
|
|
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activemodel/CHANGELOG.md) for previous changes.
|