1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/CHANGELOG.md
Jon Moss a02fb802e9 Remove CHANGELOG.md entry that appears in 5-1-stable
This CHANGELOG.md is a continuation of the 5-1-stable one, there
shouldn't be any duplicate entries.

[ci skip]
2017-03-29 08:38:01 -04:00

1 KiB

  • 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 for previous changes.