-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Time.current is getting autocorrected to Time.zone.current #70
Comments
I don't think |
The current behavior of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
I think this is handled in rubocop/rubocop#6930 (merged 7 days ago). Specifically this test case: https://github.com/rubocop-hq/rubocop/blob/a0206c99be17651f0d2941b89ddace2118909fd6/spec/rubocop/cop/rails/time_zone_spec.rb#L90-L95 |
Please move this issue to |
We should probably rewrite the TimeZone cop and have it always follow the strict mode. I also agree that |
Fixes rubocop#70. This PR fixes a false positive for `Rails/TimeZone` when setting `EnforcedStyle: strict` and using `Time.current`.
[Fix #70] Fix a false positive for `Rails/TimeZone`
Fixes rubocop#70. This PR fixes a false positive for `Rails/TimeZone` when setting `EnforcedStyle: strict` and using `Time.current`.
Thanks! |
Expected behavior
I believe
Time.current
should get updated toTime.zone.now
.Actual behavior
I believe
Time.current
gets updated toTime.zone.current
, which doesn't exist.Steps to reproduce the problem
Rails/TimeZone
toEnforcedStyle: strict
.Time.current
Is this potentially related to #6346?
RuboCop version
The text was updated successfully, but these errors were encountered: