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

With ActiveRecord::QueryLogs.prepend_comment set to true, manipulative query checks fail #68

Open
gagan93jtg opened this issue Oct 10, 2024 · 0 comments

Comments

@gagan93jtg
Copy link

If you set the above flag to true, ActiveRecord prepends the comment (query source) to the query. This causes our regex to fail because it expects the query to start with INSERT/UPDATE/DELETE. A possible fix would be to either ignore the comment or validate presence of these after the comment. The specific matcher that is failing is:

expect { some_code }.to make_database_queries(manipulative: true)

Would love to hear your thoughts on this.

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