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

Use Arel::Nodes::NamedFunction to fix COALESCE timestamp generation #1306

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bananatron
Copy link

@bensheldon
Copy link
Owner

This is lovely! Any chance you could try putting the entire COALESCE into Arel?

@bananatron
Copy link
Author

@bensheldon I almost never use Arel so lmk if this is better/worse.

@bensheldon
Copy link
Owner

Sorry, I missed entirely that the Arel was then getting to_sql'ed into a larger block of text 🤦🏻

I'm still unsure of why those spaces got inserted into the SQL previously. I'll accept this and maybe someday it will be fully Arel-ized.

@bananatron
Copy link
Author

@bensheldon I am also unsure :[ but my theory is some weird level rails dependency issue 🤷

@bananatron
Copy link
Author

bananatron commented May 11, 2024

This is coming back with a bundler update, I wonder if the ruby version is somehow involved 🤔

ActiveRecord::StatementInvalid in GoodJob::Jobs#index This prevents me from viewing my jobs page.

Showing /Users/_/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/good_job-3.28.2/app/views/good_job/jobs/index.html.erb  where line #2 raised:

PG::SyntaxError: ERROR:  syntax error at or near ":"
LINE 1: ... ( good_jobs.scheduled_at ,good_jobs.created_at ) : : TIMEST...

Rails 7.1.3.2
Ruby 3.3.1
GoodJob 3.28.2
PG 15

This PR still seems to fix the issue fwiw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

PG::SyntaxError: ERROR from timestamp
2 participants