GeorgeKaraszi/ActiveRecordExtended
64.9
Adequate · 6 November 2026
1.7k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
ActiveRecordExtended is a Ruby gem that extends ActiveRecord with advanced query capabilities for PostgreSQL, including support for unions, common table expressions, and complex JSON operations. It provides specialized methods for array containment, IP address ranges, and conditional joins, while ensuring compatibility with modern Rails versions through a modular, autoloaded architecture.
Features
Extended Arel visitor support for PostgreSQL-specific operators and functions
The library now includes a dedicated Arel visitor decorator for PostgreSQL that enables correct SQL generation for a wider range of database-specific features. This change adds support for array containment operators (@\>, \<@), HStore containment, and various inet network operators (\>\>, \<\<, \<\<=, \>\>=, &&). It also introduces visitors for JSON and array aggregation functions, including ROW\_TO\_JSON, JSON\_BUILD\_OBJECT, JSONB\_BUILD\_OBJECT, TO\_JSON, TO\_JSONB, ARRAY, and ARRAY\_AGG, as well as a new AggregateFunctionName node that supports DISTINCT, custom ordering, and aliases.
_lib/active\_record\extended/arel/visitors · high confidence
New query methods for unions, CTEs, and conditional joins
This release introduces several new query capabilities to ActiveRecord. You can now chain unions using \.union\, \.union\_all\, \.union\_except\, and \.union\_intersect\, with support for ordering and aliasing the resulting union. Common Table Expressions (CTEs) are supported via \.with\, including recursive CTEs and materialization hints (\.materialized\, \.not\_materialized\). The library adds \.any\_of\ and \.none\_of\ for building OR/AND-NOT conditions, and \.either\_join\/\.either\_order\ for performing left outer joins with fallback associations. Additionally, JSON query methods like \.select\_row\_to\_json\, \.json\_build\_object\, and \.jsonb\_build\_object\ are available for constructing JSON responses directly in queries.
_lib/active\_record\_extended/query\methods · high confidence
New utilities for ORDER BY expressions and query support
This change introduces two new helper modules within the utilities directory to enhance query construction capabilities. The \OrderBy\ module provides logic to process and sanitize ORDER BY arguments, converting hash-based ordering specifications into Arel nodes and handling table path resolution for aggregate functions. The \Support\ module adds general-purpose query helpers, including methods to safely flatten values to SQL, wrap subqueries in aliased arrays or aggregated arrays (ARRAY\_AGG), construct FROM clauses with reference keys, and manage Common Table Expression (CTE) piping via \pipe\_cte\_with!\. These utilities also include helpers for double-quoting identifiers to avoid reserved keyword conflicts and converting ActiveRecord relations to Arel SQL nodes for broader compatibility.
_lib/active\_record\extended/utilities · high confidence
Removals
Removal of legacy PostgresExtended ActiveRecord integration files
The \lib/postgres\_extended\ directory has removed several core integration files, including \active\_record.rb\, \arel.rb\, and specific version decorators for Rails 5.0 and 5.2. This deletion eliminates the previous implementation of the \.overlap\ query method and its underlying Arel node visitor logic, effectively removing support for these specific ActiveRecord versions and the associated array overlap functionality from this library location.
_lib/postgres\extended · high confidence
Behavioural changes
Library renamed from PostgresExtended to ActiveRecordExtended with Rails 8.0 support
The library has been renamed from PostgresExtended to ActiveRecordExtended, reflecting a shift in scope and compatibility. The new entry point (lib/active\_record\_extended.rb) replaces the old one and explicitly checks for ActiveRecord version 8.0 or greater, indicating support for Rails 8. The module structure has been reorganized to use ActiveSupport's autoloader for better performance and modularity, separating utilities, patches, and query methods into distinct autoloaded namespaces. This change ensures the library is properly initialized and eager-loaded when Active Record is loaded.
lib · high confidence
Library renamed to ActiveRecordExtended and version bumped to 3.5.0
The library has been renamed from PostgresExtended to ActiveRecordExtended, with the main module and version file updated accordingly (version 3.5.0). The entry point lib/active\_record\_extended/arel.rb now explicitly requires the arel nodes, sql\_literal\_patch, aggregate\_function\_name, predications, and postgresql\_decorator components, establishing the new module structure.
_lib/active\_record\extended · high confidence
Project renamed to ActiveRecordExtended with updated test schema and CI configuration
The gem has been renamed from PostgresExtended to ActiveRecordExtended, requiring users to update their Gemfile and gemset names. The project has upgraded its minimum supported Ruby version to 3.1 and Rails version to 6.1, while dropping support for older versions. Travis CI has been removed in favor of GitHub Actions, and the test database schema has been redesigned to use a 'users' table with new associations (e.g., tags, profiles) and STI support to better reflect modern usage patterns.
(repo-wide) · high confidence
Refactor Arel node structure and introduce new query capabilities
The Arel layer has been restructured to support new PostgreSQL features and improve compatibility with Rails 6.1. A new \AggregateFunctionName\ node class has been added to handle aggregate functions with aliases and ordering, while \nodes.rb\ now dynamically defines specific nodes for JSON operations (\JsonBuildObject\, \ToJson\, etc.) and array containment. The \predications.rb\ file exposes new methods for IP address containment (\inet\_contains\, \inet\_contained\_within\) and array operations (\any\, \all\, \contains\). Additionally, a patch to \Arel::Nodes::SqlLiteral\ addresses a CTE alias warning in Rails 6.1, and the project has been renamed from PostgresExtended to ActiveRecordExtended.
_lib/active\_record\extended/arel · high confidence
Updated binstubs and renamed project to ActiveRecordExtended
The project has been renamed from PostgresExtended to ActiveRecordExtended, reflected in the bin/console script which now requires active\_record\_extended. Additionally, the bin directory now includes a comprehensive set of Bundler-generated binstubs for development tools (such as byebug, coderay, dotenv, pry, rspec, and rubocop) to ensure consistent execution environments, and the bin/bundle script has been updated to correctly broker Bundler version updates.
bin · high confidence
Test coverage
Added spec support files for database cleaning and test models; Added test coverage for Arel aggregate functions and updated spec infrastructure; Added test coverage for SQL inspection features; Added test coverage for new query methods; Added tests for Arel array and inet column predicates.
Dependencies
Added CI gemfiles for ActiveRecord 7.0 through 8.1 and head
New gemfiles have been added to the gemfiles directory to support testing against ActiveRecord versions 7.0, 7.1, 7.2, 8.0, 8.1, and the current head (development version) of Rails. Each gemfile pins the specific ActiveRecord version (e.g., \~\> 7.0.0, \~\> 8.1.0) and restricts the pg gem to versions less than 2.0, enabling continuous integration to validate compatibility across these supported and upcoming ActiveRecord releases.
gemfiles · high confidence
Gem renamed to active\_record\_extended with major dependency and Ruby version updates
The gem has been renamed from postgres\_extended to active\_record\_extended, requiring users to update their Gemfile references. The minimum supported Ruby version has been raised to 3.2, and the dependency on activerecord has been loosened to allow versions 5.2 and above (previously restricted to \< 6), while the pg gem requirement is now \< 3.0. Development dependencies have been significantly updated, including bundler (\>= 2.2), database\_cleaner (\~\> 2.0), and rubocop (now including rubocop-performance, rubocop-rake, and rubocop-rspec), alongside the addition of simplecov for test coverage reporting.
(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 65 → 65 (+0.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 76 → 76 (+0.0)
- Architecture 93 → 93 (+0.0)
- Maturity 54 → 54 (+0.0)
- Readiness 64 → 64 (+0.0)
- Security 96 → 98 (+2.2)
Resolved (4)
- Confusing API surface: Exposing window_values, window_values!, and window_values? on the same class is highly unusual and confusing. Typically, ? is for boolean checks, ! for mutation, and the base for access. Having all three as distinct methods on the same receiver suggests a lack of clear intent or a copy-paste error in API design.
- Duplicate intent: Network containment logic is exposed via two different entry points with different signatures. One is a query method on the scope (Inet), the other is a predicate method (Predications). This forces users to choose between chaining styles inconsistently.
- Redundant accessors: with_values and with_values? likely return the same data or a boolean check on the same data. Having both as public methods on the main class creates confusion about which one to use.
- Redundant naming: The distinction between unionize_storage and unionize_storage! is unclear. In Ruby conventions, ! often implies mutation or danger, but here it likely just returns a different object type or forces evaluation. Without clear documentation, this looks like accidental duplication or inconsistent naming convention compared to other methods like union vs union!.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
GeorgeKaraszi/ActiveRecordExtended 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 61984c277e0f5402362ad7271f415042fc537b0e — 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.