You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using params! Time gives incorrect results in case of parameter parsing without specifying time zone.
In this case the result depends on the local zone setting on the running computer/docker, but should be determined by the time zone setting in the application configuration.
Steps for reproduction
For the same application with time zone settings:
run in docker with operation system time zone
run in docker with operation system without time zone
Rails console example
Rails Time zone is set, container time zone - different (not set)
Applications are different in this example, but it is not a key.
Mmmh this is an interesting point.
IIRC config.time_zone only affects the behaviour of Time.zone, but that's not a class so you can't really pass it to param!.
@ifellinaholeonce what do you think? I think the cleanest thing to do here is to leave Time, Date and DateTime behaviour as-is and introduce a new ActiveSupport::TimeWithZone param type that will internally coerce using Time.zone.parse
Basic Info
Description
Using
params! Time
gives incorrect results in case of parameter parsing without specifying time zone.In this case the result depends on the local zone setting on the running computer/docker, but should be determined by the time zone setting in the application configuration.
Steps for reproduction
For the same application with time zone settings:
Rails console example
Rails Time zone is set, container time zone - different (not set)
Applications are different in this example, but it is not a key.
Rails Time zone is set, container time zone - the same
The text was updated successfully, but these errors were encountered: