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

created_at value has the timezone offset applied twice (>= 5.0.0) #683

Open
Fosfen opened this issue Sep 1, 2023 · 0 comments
Open

created_at value has the timezone offset applied twice (>= 5.0.0) #683

Fosfen opened this issue Sep 1, 2023 · 0 comments

Comments

@Fosfen
Copy link

Fosfen commented Sep 1, 2023

Hello !
I've been upgrading a Rails app to Rails 5, and needed to upgrade audited to a newer version (>= 5.0.0).

Some of our unit tests failed because of timezone offset being applied twice on the created_at field for audits.
Here is an example of what happens:

Supposed server time is 1970-01-01 10:00:00 +02:00
> SomeModel.last.update!(audited_column: "fake value")

> SomeModel.last.audits.last.created_at
=> 1970-01-01 12:00:00 +02:00

Expected behavior:
> SomeModel.last.audits.last.created_at
=> 1970-01-01 10:00:00 +02:00

Obviously no problem appears when the app runs on a UTC local time.
The issue seems to happen only with audits (no other model is impacted), is there a way to get the correct timestamp for audits ?

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

No branches or pull requests

1 participant