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

Cast PostgreSQL's timestamptz columns to time #1325

Merged
merged 2 commits into from
May 23, 2022

Conversation

lucasfais
Copy link
Contributor

Before Rails 7, PostgreSQL's timestamptz columns were handled as datetime, but now type returns :timestamptz:

irb(main):181:0> User.columns_hash['created_at'].type
=> :timestamptz

I tested this PR's change in my production app, it's working fine, but let me know if this is not the correct/complete fix for the issue.

@scarroll32
Copy link
Member

@lucasfais thank you for this PR.

Could you please add a couple of tests?

@lucasfais
Copy link
Contributor Author

@scarroll32 Sure. Ransack::Nodes::Value had no specs, so I added basic specs for all types. :timestamptz specially is on line 28. Thanks!

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@scarroll32 scarroll32 merged commit 5d2bb20 into activerecord-hackery:main May 23, 2022
@scarroll32
Copy link
Member

Thank you @lucasfais !

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.

None yet

3 participants