Skip to content
CAI
Software that uses CAICheck a score

activerecord-hackery/ransack

60.8

Adequate · 14 November 2026

4.5k

lines of production code

Ruby

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Turbo integration and refine form builder options

The form helpers now support Hotwire/Turbo via a new \turbo\_search\_form\_for\ helper that submits via Turbo streams, and the \FormBuilder\ can be dynamically swapped via the \RANSACK\_FORM\_BUILDER\ environment variable (e.g., to use SimpleForm). Additionally, \attribute\_select\ and \predicate\_select\ now accept \:default\ and \:only\ options to customize initial selections and filter available predicates, while \sort\_select\ is split into separate \attribute\_select\ and \sort\_direction\_select\ calls for better flexibility.

lib/ransack/helpers · high confidence

Removals

Removal of legacy ActiveRecord adapter files

The \lib/ransack/adapters/active\_record/base.rb\ and \lib/ransack/adapters/active\_record/context.rb\ files have been deleted. This removes the legacy implementation of the \search\ method aliasing and the custom \Context\ class that handled query evaluation, association resolution, and join dependency building for ActiveRecord. Users relying on these specific internal adapter components will need to ensure their codebase uses the current adapter structure.

_lib/ransack/adapters/active\record · high confidence

Behavioural changes

Active Record integration refactored into Ransack::ActiveRecord with stricter search validation

The Active Record adapter has been moved from Ransack::Adapters::ActiveRecord to Ransack::ActiveRecord, with the old namespace retained only for backward compatibility with a deprecation warning. This change introduces stricter validation for search parameters: unknown conditions now raise Ransack::InvalidSearchError by default (unless \ignore\_unknown\_conditions\ is explicitly enabled), and search keys are limited to a maximum depth of 200 underscore-separated segments to prevent CPU-exhaustion denial-of-service attacks. Additionally, the library now supports configuring \NULLS FIRST\ and \NULLS LAST\ behavior for sort orders across different database dialects.

lib/ransack · high confidence

Improved join aliasing and association path handling in search queries

Ransack now better preserves table aliases for joins added by a search when additional joins are appended to the result, preventing conditions from being misapplied to the wrong tables. It also ensures that nested associations are joined after their parent eager loads, and restricts attribute lookups to explicitly allowlisted paths rather than binding to arbitrary columns, which resolves issues with temporary tables and case-sensitivity in SQLite. Also in this area: Improved correlated subquery generation and join management for negative conditions; Fixes false-value handling, polymorphic type validation, and regex performance; Strong parameters now authorize models without explicit allowlists; Active Record integration refactored into Ransack::ActiveRecord with stricter search validation.

_lib/ransack/active\record · high confidence

Introduce RuboCop linting and modernize development workflow

The project now enforces code style and quality using RuboCop (targeting Ruby 3.2), with a new \.rubocop.yml\ configuration and updated \Rakefile\ tasks (\test\, \test\_pg\, \test\_mysql\, \test\_all\, \test\_detected\) that run both RuboCop and RSpec. The default rake task now runs the combined test suite, and the development console has switched from IRB to Pry. Documentation has moved to a Jekyll/Just the Docs site, replacing the old README.rdoc, and the repository structure has been cleaned up (e.g., removing the old spec file and adding a \.nojekyll\ marker).

(repo-wide) · high confidence

Lazy-load Rails integration helpers via ActiveSupport hooks

Ransack now defers loading its Action Controller and Active Record adapters until the respective frameworks are ready, using \ActiveSupport.on\_load\ hooks instead of requiring them immediately at startup. This change improves application boot times and compatibility by ensuring dependencies like \ActionController::Base\ and \ActiveRecord::Base\ are fully loaded before Ransack attempts to extend them, while also introducing a dedicated deprecator for version 7.0.

lib · high confidence

Refactored search nodes to support ransacker arguments, aliases, and strict validation

The search node architecture has been refactored to improve binding, validation, and extensibility. Attribute and Sort nodes now include the new Bindable module, enabling proper resolution of attribute aliases and support for ransacker arguments (ransacker\_args). The Condition node now accepts ransacker\_args when building attributes and validates them against the context. Grouping nodes have replaced the separate And/Or classes with a unified Groupings collection, and combinator handling is now centralized in the Node base class, raising an InvalidSearchError for invalid or mixed combinators in strict mode. Value casting has been simplified to use a single value attribute and now includes support for PostgreSQL money and timestamptz types, as well as improved handling of Date-to-Time conversions.

lib/ransack/nodes · high confidence

Removed direct Active Record adapter entry point

The \lib/ransack/adapters/active\_record.rb\ file has been removed, eliminating the direct entry point that previously required the base and context adapter files. This change aligns with the project's move toward ORM agnosticism, where Active Record adapters are loaded only if Active Record is already defined, rather than being forcibly required by the adapter file itself.

lib/ransack/adapters · high confidence

Test coverage

Added test coverage for Ransack node value casting, condition handling, and grouping logic; Added test coverage for Ransack search key depth limits and configuration options; Added tests for Ransack search behavior with Time scopes, temporary tables, and join ordering; Expanded test coverage for Ransack form helpers; Expanded test suite with multi-database support and new model features; Migrate test data generation from Blueprints to FactoryBot; Migrate test suite from Machinist to FactoryBot; Remove obsolete ActiveRecord adapter specs.

Dependencies

Upgrade to Rails 7.2+ and modernize documentation tooling

The gem now requires Ruby 3.2+ and Active Record 7.2+, dropping support for older Rails and Ruby versions. The documentation site has been migrated from Docusaurus to Jekyll with the Just the Docs theme, and the main Gemfile now uses HTTPS for RubyGems and Rails sources, adds explicit dependencies for sqlite3 (\>= 2.9.5 to address [CVE redacted]), pg, mysql2, and trilogy, and updates test dependencies to factory\_bot and RSpec 3.

(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

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 63 → 61 (-2.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 56 → 53 (-3.4)
  • Architecture 98 → 98 (-0.1)
  • Maturity 62 → 62 (+0.4)
  • Readiness 68 → 68 (+0.0)
  • Security 77 → 68 (-9.1)

Resolved (1)

  • Off-boarding risk: anonymized user #1

New (3)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 13 commits — 12 feature/other, 1 fixes

By area

  • lib/ransack — 5 commits
  • .github/workflows — 2 commits
  • spec/ransack — 2 commits
  • docs/Gemfile.lock — 1 commit
  • docs/_project — 1 commit
  • docs/assets — 1 commit
  • lib/ransack.rb — 1 commit

Notable commits

  • fix: Comment out the case-insensitive SQLite table spec until Rails fixes it (#1800)
  • change: Add arel_node: let a predicate build a finished Arel node (#1789)
  • change: Build correlated subqueries with the model Arel table (#1795)
  • change: Bump nokogiri in /docs in the bundler group across 1 directory (#1801)
  • change: Document how to report a vulnerability and how maintainers handle one (#1790)
  • change: Keep the term as text for LIKE predicates on non-text columns (#1794)
  • change: Merge commit from fork
  • change: Pin test workflow runners to ubuntu-24.04 (#1802)
  • change: Require active_support before its core extensions (#1792)
  • change: Run CI against Rails main, allowed to fail (#1798)
  • change: Spec that the correlated subquery is built from an Arel table (#1796)
  • change: Use the ActiveRecord Hackery logo as the Ransack logo (#1791)
  • change: Version 6.1.0 (#1758)

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

Survey your own repository

activerecord-hackery/ransack 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 14 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 1ed0ff426aefc813ed14a253d77b6c923ce850f1 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — 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.65+preprod-36d4cd83012f.