Skip to content
CAI
Software that uses CAICheck a score

heartcombo/has_scope

59.6

Adequate · 6 November 2026

215

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Ruby gem that provides a \has\_scope\ helper for Rails applications, enabling the declaration and application of query scopes based on request parameters. It supports modern Ruby and Rails versions, offering features like type validation, flexible parameter passing, and deprecation warnings to ensure safe and maintainable controller logic.

Behavioural changes

Dropped support for older Ruby and Rails versions

The library now requires Ruby 2.7 or higher and Rails 7 or higher. Support for Ruby versions below 2.7 and Rails versions below 7 has been removed, aligning the gem with current supported versions of the Ruby and Rails ecosystems.

(repo-wide) · high confidence

Introduces Rails deprecation warnings via Railtie

The library now registers a dedicated deprecator with the Rails application through a new Railtie. This ensures that any deprecated features used within has\_scope will trigger standard Rails deprecation warnings, helping users identify and update legacy usage patterns.

_lib/has\scope · high confidence

Refactored scope configuration and added type validation options

The library now uses \class\_attribute\ instead of \class\_inheritable\_accessor\ for scope configuration, ensuring correct inheritance behavior in modern Ruby/Rails versions. A new \:type\ option allows explicit validation of parameter types (array, hash, boolean, default), replacing the previous \:boolean\ flag and preventing accidental hash/array injection. New \:using\ and \:in\ options enable passing multiple parameters to a scope from a single hash, while \:allow\_blank\ controls whether blank values trigger the scope. The \apply\_scopes\ method now accepts an optional hash argument for flexibility, and default values can be procs that optionally receive the controller instance.

lib · high confidence

Test coverage

Expanded test coverage for new scope options and modernized test suite

The test suite has been significantly expanded to cover new \has\_scope\ capabilities, including the \:using\, \:in\, and \:allow\_blank\ options, as well as custom type parsing (e.g., \:date\). Tests now verify that boolean scopes with \allow\_blank\ correctly handle true, false, and missing parameter states, and that scopes using \:in\ respect default values and blank checks. The test infrastructure has also been modernized to use \minitest\ and \mocha\ with updated syntax, and a deprecation silencer was added to the test helper to suppress warnings for deprecated string-based \if\/\unless\ options while still testing their behavior.

test · high confidence

Dependencies

Expanded Rails version compatibility for testing

The gemfiles directory now includes dedicated configuration files for testing against Rails 7.0, 7.1, 7.2, and 8.0, as well as the Rails main branch. This allows the library to be validated against a broader range of Rails versions, ensuring compatibility with both recent stable releases and the latest development version.

gemfiles · high confidence

Update Rails dependencies to 8.1 and raise minimum Ruby version

The gem now requires Ruby 2.7 or higher and explicitly depends on Action Pack and Active Support 8.1.0 in the development environment, while maintaining runtime compatibility with Rails 7.0 and above. This update aligns the project with the latest Rails 8.1 release cycle for testing and development purposes.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 59 → 60 (+0.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 43 → 43 (+0.0)
  • Readiness 78 → 78 (+0.0)
  • Security 89 → 98 (+8.9)

Findings

  • No change — the same findings as the prior survey.

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

Survey your own repository

heartcombo/has_scope 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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit ad5141db29f992be3ef833aeafdfeaf9c704b397 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.