We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When running a query using an association, ActiveRecord has changed to use prepared statements with bind parameters, something like:
"select * from comments where post_id = $1", [["post_id", 123]]
so when to_sql is called on the relation, the $1 is not yet interpolated.
to_sql
Solution: use connection.unprepared_statement { to_sql } syntax to skip preparation. Cursor declaration includes preparation anyway.
connection.unprepared_statement { to_sql }
The text was updated successfully, but these errors were encountered:
e8630d5
No branches or pull requests
When running a query using an association, ActiveRecord has changed to use prepared statements with bind parameters, something like:
so when
to_sql
is called on the relation, the $1 is not yet interpolated.Solution: use
connection.unprepared_statement { to_sql }
syntax to skip preparation. Cursor declaration includes preparation anyway.The text was updated successfully, but these errors were encountered: