aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
blob: cdba0cee12bffad35d497d4a800159f81b65eca9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
*   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.

     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   # => []

    *bogdanvlviv*


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