-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
improve time zone deprecation warning #30954
improve time zone deprecation warning #30954
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @eileencodes (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
@@ -98,11 +98,14 @@ def create_time_zone_conversion_attribute?(name, cast_type) | |||
still causes `String`s to be parsed as if they were in `Time.zone`, | |||
and `Time`s to be converted to `Time.zone`. | |||
|
|||
To silence this deprecation warning, add one of the following to your | |||
initializer: | |||
|
|||
To keep the old behavior, you must add the following to your initializer: |
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.
Thanks for the PR! These two lines are repetitive. I think the new line should be removed and that the next change you made should read "To use the new behavior, add the following:"
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.
wow, thanks for responding so quickly! The changes have been made :)
Thanks! and congrats on your first Rails PR 😄 |
Summary
The deprecation warning about the new time zone aware columns is Rails 5.1 is a little unclear. It suggests that adding
config.active_record.time_zone_aware_types = [:datetime, :time]
to your project will merely silence the deprecation warning, when in fact it will make your project use the new behaviour.Other Information
I didn't add any information to the changelog here because one could argue that this is a documentation change... I'd be more than happy to add it though if needed.
Thanks a bunch! 🎉 ✨