New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimeZone requires preloading before #freeze #1977
Conversation
@@ -289,6 +289,12 @@ module ActiveSupport | |||
Time.now.utc.in_time_zone(self) | |||
end | |||
|
|||
# Preload information prior to freezing | |||
def freeze | |||
tzinfo; utc_offset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better split this line into two, and get rid of the semicolons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm agree. Can you amend your patch and force-push to your branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry guys, was on vacation. I can certainly do that. I'll get it in today.
'Can't modify frozen object' when calling #freeze after instantiation
@sikachu Sorry for the delay. Hope this meets your approval. Thanks again for taking a look at this! |
+1 |
Not sure about the orignal issue. But what's going on about this PR? |
Is this still an issue? |
This was previously an issue for me but I haven't been hacking on timezones in a while. I just tried it again and cannot reproduce. I'll close it for now. |
'Can't modify frozen object' when calling #freeze after instantiation
Although I did add tests to this which should have failed, for some reason they didn't. If someone with more knowledge of Rails dependencies could help me out I would appreciate it.
The issue this fixes is here: #1966
There is a 100% repeatable (on the 3 MacBooks I tried) bug wherein executing the following:
And within IRB:
Raises a
Can't modify a frozen object
RuntimeError.Although I can get this error to occur every time, I cannot get it to be reproduced in a test.
I hope this at least puts everyone on the right track to tracking down this problem.