2015-01-04 08:18:03 +00:00
|
|
|
* Add `ActiveModel::Errors#details`
|
|
|
|
|
|
|
|
To be able to return type of used validator, one can now call `details`
|
|
|
|
on Errors instance:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
class User < ActiveRecord::Base
|
|
|
|
validates :name, presence: true
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
user = User.new; user.valid?; user.errors.details
|
|
|
|
=> {name: [{error: :blank}]}
|
|
|
|
```
|
|
|
|
|
|
|
|
*Wojciech Wnętrzak*
|
|
|
|
|
2015-01-10 16:35:58 +00:00
|
|
|
* Change validates_acceptance_of to accept true by default.
|
|
|
|
|
|
|
|
The default for validates_acceptance_of is now "1" and true.
|
2015-01-04 08:18:03 +00:00
|
|
|
In the past, only "1" was the default and you were required to add
|
2015-01-10 16:35:58 +00:00
|
|
|
accept: true.
|
|
|
|
|
2015-01-03 21:20:30 +00:00
|
|
|
* Remove deprecated `ActiveModel::Dirty#reset_#{attribute}` and
|
|
|
|
`ActiveModel::Dirty#reset_changes`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2014-12-24 08:58:19 +00:00
|
|
|
* Change the way in which callback chains can be halted.
|
|
|
|
|
|
|
|
The preferred method to halt a callback chain from now on is to explicitly
|
|
|
|
`throw(:abort)`.
|
|
|
|
In the past, returning `false` in an ActiveModel or ActiveModel::Validations
|
|
|
|
`before_` callback had the side effect of halting the callback chain.
|
|
|
|
This is not recommended anymore and, depending on the value of the
|
|
|
|
`config.active_support.halt_callback_chains_on_return_false` option, will
|
|
|
|
either not work at all or display a deprecation warning.
|
2014-12-08 14:35:25 +00:00
|
|
|
|
|
|
|
|
2014-11-28 17:00:06 +00:00
|
|
|
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes.
|