CHANGELOG.md 1.6 KB
Newer Older
1 2 3 4
*   Fix to working before/after validation callbacks on multiple contexts.

    *Yoshiyuki Hirano*

5 6 7 8 9
## Rails 5.2.0.beta2 (November 28, 2017) ##

*   No changes.


10 11
## Rails 5.2.0.beta1 (November 27, 2017) ##

12 13 14 15
*   Execute `ConfirmationValidator` validation when `_confirmation`'s value is `false`.

    *bogdanvlviv*

16 17 18 19
*   Allow passing a Proc or Symbol to length validator options.

    *Matt Rohrer*

J
Jahfer Husain 已提交
20 21 22 23
*   Add method `#merge!` for `ActiveModel::Errors`.

    *Jahfer Husain*

R
Ryuta Kamizono 已提交
24
*   Fix regression in numericality validator when comparing Decimal and Float input
25 26 27 28
    values with more scale than the schema.

    *Bradley Priest*

29 30 31 32 33 34
*   Fix methods `#keys`, `#values` in `ActiveModel::Errors`.

    Change `#keys` to only return the keys that don't have empty messages.

    Change `#values` to only return the not empty values.

R
Ryuta Kamizono 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    Example:

        # Before
        person = Person.new
        person.errors.keys     # => []
        person.errors.values   # => []
        person.errors.messages # => {}
        person.errors[:name]   # => []
        person.errors.messages # => {:name => []}
        person.errors.keys     # => [:name]
        person.errors.values   # => [[]]

        # After
        person = Person.new
        person.errors.keys     # => []
        person.errors.values   # => []
        person.errors.messages # => {}
        person.errors[:name]   # => []
        person.errors.messages # => {:name => []}
        person.errors.keys     # => []
        person.errors.values   # => []
56 57 58

    *bogdanvlviv*

59

M
Matthew Draper 已提交
60
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activemodel/CHANGELOG.md) for previous changes.