brendon/ranked-model
55.7
Adequate · 6 November 2026
374
lines of production code
Ruby
primary language
4
measurements over time
What this system is
RankedModel is a Ruby gem that provides row sorting capabilities for ActiveRecord models within Rails applications. It enables the maintenance of multiple ordered lists per model and handles rank rebalancing, position updates, and edge cases like Single Table Inheritance. The library supports a wide range of Rails and Ruby versions, ensuring compatibility across various database backends.
How it got here
2011 — Initial gem release and test infrastructure
10 changes.
This period focused on the initial release of the RankedModel gem, establishing its core functionality for maintaining multiple ordered lists in Rails applications. The work included setting up the gem structure, implementing Railtie integration, and building comprehensive test coverage to validate ranking logic, edge cases, and Single Table Inheritance support.
2013–2026 — Test coverage and Rails compatibility
4 changes.
This period focused on expanding test coverage for the Ego, Player, and Number models, specifically addressing ranking logic and SQL keyword handling. Additionally, Appraisal gemfiles were added to enable compatibility testing against Rails versions 7.2, 8.0, and 8.1 across multiple database backends.
Features
Initial release of RankedModel gem with multi-ranker support
This change introduces the RankedModel gem, enabling ActiveRecord models to maintain multiple ordered lists (rankers) via the \ranks\ DSL method. It provides public accessors for position (\name\_position\) and rank (\name\_rank\), automatically handles ranking updates on save, and validates that ranked columns do not have database defaults. The implementation supports signed 32-bit integer ranges for rank values and includes a Railtie for Rails integration.
lib · high confidence
Initial release of ranked-model gem with Rails 4.2–7.0 support
This change introduces the ranked-model gem, a row sorting library for Rails applications. It adds the core gemspec, license, and Rakefile, along with a comprehensive CI configuration (Appraisals and .travis.yml) that enables testing across Rails versions 4.2 through 7.0 and Ruby versions 2.4 through 3.0 (including JRuby). The initial release includes documentation and configuration files necessary for users to integrate the gem into their projects.
(repo-wide) · high confidence
Rails integration for ranked-model
The application now automatically loads the ranked-model Railtie when the Rails framework initializes, enabling the gem's functionality within the Rails environment without requiring manual configuration.
rails · high confidence
Behavioural changes
RankedModel v0.4.11 introduces Railtie integration and refined ranking logic
This update brings RankedModel to version 0.4.11, adding a new Railtie (\lib/ranked-model/railtie.rb\) to initialize the gem within Rails applications. The core ranking behavior in \ranker.rb\ has been refined to handle edge cases more robustly, including support for string-based position values ('first', 'last', 'middle'), improved handling of up/down ordering, and fixes for SQL syntax errors and unbounded queries. The gem now also validates that records are persisted before attempting rank rebalancing and ensures unique indexes are respected during rank updates.
lib/ranked-model · high confidence
Test coverage
Added test coverage for ActiveSupport notifications and test infrastructure; Added test coverage for STI model ranking behavior; Added test coverage for ranked model edge cases and validation; Added test database configuration and schema for ActiveRecord specs; Added test for updating rank of existing player record; Added tests for Ego model ranking functionality; Added tests for keyword column name handling in Number model; Added tests for the ranker's \unless\ option and rank rebalancing bounds.
Dependencies
Added Appraisal gemfiles for Rails 7.2, 8.0, and 8.1
New Appraisal gemfiles have been added to support testing against ActiveRecord versions 7.2, 8.0, and 8.1. These files configure the gem dependencies for SQLite, PostgreSQL, and MySQL databases for each respective Rails version, enabling compatibility testing across these specific framework releases.
gemfiles · high confidence
Initial gemspec and Gemfile setup for ranked-model
The project introduces a standard Ruby gem structure with a new \ranked-model.gemspec\ and \Gemfile\. The gemspec defines the library as an acts\_as\_sortable replacement for Rails 4.2+ (with a runtime dependency on ActiveRecord \>= 5.2) and lists development dependencies including RSpec, database\_cleaner, and appraisal. The Gemfile configures the gemspec as the source and adds specific database adapter gems (sqlite3, pg, mysql2) for testing 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 52 → 56 (+3.8)
- 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 28 → 36 (+8.1)
- Readiness 74 → 74 (+0.0)
- Security 97 → 95 (-2.1)
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
brendon/ranked-model 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 b535f557ee967abf90dc3463e815791f9f42abd4 — 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.