rails/activemodel/test
Andrew White ccdedeb9d5
Fix year value when casting a multiparameter time hash
When assigning a hash to a time attribute that's missing a year
component (e.g. a `time_select` with `:ignore_date` set to `true`)
then the year defaults to 1970 instead of the expected 2000. This
results in the attribute changing as a result of the save.

Before:

    event = Event.new(start_time: { 4 => 20, 5 => 30 })
    event.start_time # => 1970-01-01 20:30:00 UTC
    event.save
    event.reload
    event.start_time # => 2000-01-01 20:30:00 UTC

After:

    event = Event.new(start_time: { 4 => 20, 5 => 30 })
    event.start_time # => 2000-01-01 20:30:00 UTC
    event.save
    event.reload
    event.start_time # => 2000-01-01 20:30:00 UTC
2019-01-21 09:23:12 +00:00
..
cases Fix year value when casting a multiparameter time hash 2019-01-21 09:23:12 +00:00
models Fix numericality validator to still use value before type cast except Active Record 2018-08-24 00:44:02 +09:00
validators Use frozen string literal in activemodel/ 2017-07-16 20:11:16 +03:00