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

Set Rails/Date, AllowToTime config to false. #80

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

Bhacaz
Copy link
Collaborator

@Bhacaz Bhacaz commented Mar 12, 2024

Date#to_time Return the time with the timezone of the host/server.

So it may vary from an env to another.

in_time_zone should be use.

> Date.current.to_time
"2024-03-12T00:00:00.000-04:00"

> Date.current.in_time_zone
Tue, 12 Mar 2024 00:00:00 UTC +00:00

https://docs.rubocop.org/rubocop-rails/cops_rails.html#allowtotime-false

@Bhacaz Bhacaz marked this pull request as ready for review March 12, 2024 19:08
@Bhacaz Bhacaz requested a review from matosga March 12, 2024 19:08
Copy link

@matosga matosga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a good idea, nice!

@Bhacaz Bhacaz merged commit ba9b027 into main Mar 13, 2024
1 check passed
@Bhacaz Bhacaz deleted the update_date_time_base_config branch March 13, 2024 12:23
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.

2 participants