-
Ryuta Kamizono authored
Originally, time object is decorated after `changes_applied` by `forgetting_assignment` (`value_for_database`). https://github.com/rails/rails/blob/d2cdf0be675b44771f950697fc0b19ef0ea453f9/activemodel/lib/active_model/attribute.rb#L67-L69 https://github.com/rails/rails/blob/d2cdf0be675b44771f950697fc0b19ef0ea453f9/activemodel/lib/active_model/attribute.rb#L55-L57 Before #36352, fortunately `apply_seconds_precision` will return undecorated new time object by everytime `value.change` is called. Now, we need to explicitly check a time value is decorated or not in `cast_value`. Fixes #36910.
Ryuta Kamizono authoredOriginally, time object is decorated after `changes_applied` by `forgetting_assignment` (`value_for_database`). https://github.com/rails/rails/blob/d2cdf0be675b44771f950697fc0b19ef0ea453f9/activemodel/lib/active_model/attribute.rb#L67-L69 https://github.com/rails/rails/blob/d2cdf0be675b44771f950697fc0b19ef0ea453f9/activemodel/lib/active_model/attribute.rb#L55-L57 Before #36352, fortunately `apply_seconds_precision` will return undecorated new time object by everytime `value.change` is called. Now, we need to explicitly check a time value is decorated or not in `cast_value`. Fixes #36910.
Loading