Skip to content
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

Merged

Conversation

berlintam
Copy link

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! 🎉 ✨

@rails-bot
Copy link

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.

@rails-bot
Copy link

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against 5-0-stable. Please double check that you specified the right target!

@@ -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:
Copy link
Member

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:"

Copy link
Author

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 :)

@eileencodes eileencodes merged commit b39e940 into rails:5-0-stable Oct 23, 2017
@eileencodes
Copy link
Member

Thanks! and congrats on your first Rails PR 😄

@berlintam berlintam deleted the improve-time-zone-deprecation-warning branch October 23, 2017 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants