This project is archived and is in readonly mode.
TimeWithZone should not accept unrecognized time zones
-
Marc-André Lafortune
- Tag changed from bug active to activesupport, bug, timewithzone
-
Josh Kalderimis
- Tag changed from activesupport, bug, timewithzone to activesupport
- State changed from new to open
- Importance changed from to Low
Hi Marc-André,
I agree with this. Are you able to whip up a patch with tests?
Thanks,
Josh
-
Marc-André Lafortune
Sure, will do.
-
Marc-André Lafortune
Here is my patch.
{Date}Time#in_time_zone,Time.use_zoneandTime.zone=now raise anArgumentErroron invalid timezone arguments.Note that I changed
test_time_zone_setter_with_invalid_zonewhich used to imply thatTime.zone = "foo"was a no-op. There was no test forin_time_zonenor foruse_zone.Thanks
-
Josh Kalderimis
- Assigned user set to Santiago Pastorino
Hey Marc,
I think the patch and tests look good.
+1 from me, I prefer having ActiveSupport raise an error if the timezone is incorrect.
Santiago, what do you think?
Josh
