`QueryRecorder#occurrences_by_line_method` returns a sorted array based on `data`, sorted by `count`.
This will log calls to QueryRecorder into the `test.log`. For example:
1. You can output the call backtrace for the specific `QueryRecorder` instance you want
by using `ActiveRecord::QueryRecorder.new(query_recorder_debug: true)`. The output
will be in `test.log`
```plaintext
QueryRecorder SQL: SELECT COUNT(*) FROM "issues" WHERE "issues"."deleted_at" IS NULL AND "issues"."project_id" = $1 AND ("issues"."state" IN ('opened')) AND "issues"."confidential" = $2
1. Using the environment variable `QUERY_RECORDER_DEBUG`, the call backtrace will be output for all tests.
To enable this, run the specs with the `QUERY_RECORDER_DEBUG` environment variable set. For example:
This will log calls to QueryRecorder into the `test.log` file. For example:
```plaintext
QueryRecorder SQL: SELECT COUNT(*) FROM "issues" WHERE "issues"."deleted_at" IS NULL AND "issues"."project_id" = $1 AND ("issues"."state" IN ('opened')) AND "issues"."confidential" = $2