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
Matt Rohrer b8b089ef11
Allow passing a Proc or Symbol as an argument to length validator values
This brings the Length validator in line with the Numericality
validator, which currently supports Proc & Symbol arguments
2017-10-26 10:01:06 +02:00

1.3 KiB

  • Allow passing a Proc or Symbol to length validator options.

    Matt Rohrer

  • Add method #merge! for ActiveModel::Errors.

    Jahfer Husain

  • Fix regression in numericality validator when comparing Decimal and Float input values with more scale than the schema.

    Bradley Priest

  • 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.