Skip to content

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

Open
@gagan93jtg

Description

@gagan93jtg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions