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

Remove usage of COALESCE from dashboard chart #1306

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

bananatron
Copy link
Contributor

@bensheldon
Copy link
Owner

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

@bananatron bananatron force-pushed the fix-coalesce-timestamp branch from a8d93c5 to f9400d1 Compare March 30, 2024 04:00
@bananatron
Copy link
Contributor 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
Contributor Author

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

@bananatron
Copy link
Contributor 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.

@bensheldon bensheldon added the refactor Code changes that do not introduce new features label Nov 28, 2024
@bensheldon bensheldon changed the title Use Arel::Nodes::NamedFunction to fix COALESCE timestamp generation Remove usage of COALESCE from dashboard chart Nov 28, 2024
@bensheldon bensheldon merged commit ee33626 into bensheldon:main Nov 28, 2024
46 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that do not introduce new features
Projects
Development

Successfully merging this pull request may close these issues.

PG::SyntaxError: ERROR from timestamp
2 participants