Skip to content
CAI
Software that uses CAICheck a score

brunofacca/active-record-query-trace

61.9

Adequate · 20 September 2026

213

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that provides configurable SQL query tracing for ActiveRecord applications. It allows developers to monitor database queries by filtering them based on type, suppressing cached results, and customizing the detail level of the generated backtraces. The library supports modern versions of Rails and Ruby, ensuring compatibility with current framework releases.

Behavioural changes

Major refactoring and expanded configuration options for query tracing

The library has been significantly refactored, moving from the \QueryTrace::ActiveRecord\ namespace to \ActiveRecordQueryTrace\ and introducing a comprehensive set of configuration options. Users can now control the trace output with new settings: \lines\ to limit the number of backtrace lines displayed, \ignore\_cached\_queries\ to suppress output for cached SQL, \query\_type\ to filter traces by read or write operations, and \suppress\_logging\_of\_db\_reads\ to hide read-only queries. The backtrace cleaner is now customizable via a \level\ setting (\:app\, \:rails\, \:full\, or \:custom\) and supports a custom cleaner proc, allowing for tailored trace formatting. Additionally, the output now supports colorization via the \colorize\ option.

lib · high confidence

Migration from Rails plugin to standard gem with updated tooling and CI

The project has been converted from a legacy Rails plugin (using init.rb and install.rb) to a standard Ruby gem, removing the old plugin hooks and updating the Rakefile to use bundler, RSpec, and RuboCop. The gem now targets Ruby 2.7+ (with .ruby-version set to 3.2.2) and supports Rails 7.2, 8.0, 8.1, and main via Appraisals. CI has migrated from Travis to GitHub Actions, and configuration files like .rubocop.yml and .rspec have been added to enforce code style and test formatting.

(repo-wide) · high confidence

Test coverage

Added in-memory database setup for database tests; Initial RSpec test suite setup; Initial test suite for ActiveRecordQueryTrace configuration; Removal of legacy test infrastructure.

Dependencies

Add support for Rails 7.2, 8.0, 8.1, and main branches

The gemfiles directory now includes generated Appraisal configurations for Rails 7.2, 8.0, 8.1, and the Rails main branch (8.2.0.alpha). This allows the library to be tested against these specific Rails versions, ensuring compatibility with the latest releases and development versions of the framework.

gemfiles · high confidence

Rails 7.0 support and Ruby 3.2+ requirement

The gem now requires Ruby 3.2 or higher and defaults to using Rails 7.0 in development, while maintaining compatibility with ActiveRecord 6.0.0 and above. This update aligns the project with modern Ruby and Rails versions, ensuring support for the latest language features and framework capabilities.

(dependencies) · high confidence

Housekeeping

Version bump to 1.9

The library version has been updated to 1.9.

_lib/active\_record\_query\trace · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 62.

Lenses

  • Code Health 98
  • Architecture 69
  • Maturity 50
  • Readiness 62
  • Security 100

Changes since last survey

  • 158 commits — 134 feature/other, 24 fixes

By area

  • (root) — 78 commits
  • (repo) — 41 commits
  • lib/active_record_query_trace.rb — 25 commits
  • gemfiles/rails_7.2.gemfile.lock — 7 commits
  • .github/workflows — 1 commit
  • gemfiles/rails60.gemfile — 1 commit
  • gemfiles/railsmaster.gemfile — 1 commit
  • lib/active_record_query_trace — 1 commit
  • lib/version.rb — 1 commit
  • spec/db — 1 commit
  • spec/lib — 1 commit

Notable commits

  • fix: Fix #30 ignore_cached_queries
  • fix: Fix Performance/ConstantRegexp
  • fix: Fix broken Markdown headings
  • fix: Fix for Layout/LineEndStringConcatenationIndentation
  • fix: Fix for Layout/MultilineMethodCallIndentation
  • fix: Fix for RSpec/BeEq
  • fix: Fix for RSpec/BeNil
  • fix: Fix for Rails/Present
  • fix: Fix for Style/SelectByRegexp
  • fix: Fix for Style/StringLiterals
  • fix: Fix rubocop warnings
  • fix: Fix some rubocop issues
  • fix: Fix the colorize = true setting
  • fix: Fix version require in gemspec
  • fix: Fixed Rails 4.2 backtrace_cleaner root filter with sql-logging gem
  • fix: Merge pull request #29 from onboardiq/fix/version
  • fix: Merge pull request #31 from ruckus/fix-ignore-cached-queries
  • fix: Merge pull request #45 from CvX/fix-default-color
  • fix: Merge pull request #63 from jvlara/fix/colisions-with-other-gems-in-backtrace-cleaner
  • fix: added LICENSE info to spec. Fixes #7
  • …and 138 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

brunofacca/active-record-query-trace was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 134620a1c725e31da95dc0513e9b479988b8a367 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.