Skip to content
CAI
Software that uses CAICheck a score

shioyama/mobility

66.1

Adequate · 20 September 2026

6.1k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Mobility is a Ruby gem that provides a modular, plugin-based architecture for managing localized attributes in ActiveRecord and Sequel models. It supports diverse storage strategies, including dedicated translation tables, native database columns, and JSON/Hstore types, while offering features like dirty tracking, caching, and locale fallbacks. The system is designed for extensibility, allowing developers to compose specific backend and plugin combinations to suit their application's performance and data storage requirements.

How it got here

2016 — Plugin architecture and ORM expansion

9 changes.

The project underwent a major architectural refactoring to replace its monolithic structure with a modular plugin system, enabling support for the Sequel ORM alongside ActiveRecord. This period focused on establishing the new configuration and backend APIs, expanding the test suite to cover multiple databases and storage backends, and preparing the library for its v1.3.0 release.

2017–2020 — Modular plugin architecture and backend refactoring

26 changes.

The project underwent a major architectural shift, refactoring the monolithic codebase into a modular plugin system to separate concerns like caching, dirty tracking, and querying. This period saw the restructuring of ActiveRecord and Sequel backends into distinct, opt-in components, alongside significant updates to Rails generators for v1.0 compatibility. Extensive test coverage was added to validate the new plugin infrastructure, backend implementations, and performance constraints.

Features

Active Model dirty tracking and cache clearing plugins

Added new \active\_model\_dirty\ and \active\_model\_cache\ plugins to support dirty tracking and cache management for models using Active Model. The dirty plugin dynamically defines methods like \title\_changed?\ and \restore\_title!\ by introspecting the \ActiveModel::Dirty\ module, ensuring compatibility across Rails versions and supporting keyword arguments for methods such as \will\_save\_change\to\\*?\. It also patches core methods like \changed\_attributes\ to include translated attributes. The cache plugin adds hooks to clear the Mobility cache when dirty reset methods are called, ensuring consistency between the ORM's change tracking and Mobility's internal state.

_lib/mobility/plugins/active\model · high confidence

Initial project scaffolding and configuration

This change establishes the foundational structure for the Mobility gem, introducing configuration files for code quality and linting (.codeclimate.yml, .rubocop.yml), documentation standards (CONTRIBUTING.md, ISSUE\_TEMPLATE.md), and build automation (Rakefile with database setup tasks). It also includes the initial README, changelog, and CI configuration (.travis.yml), setting the stage for the library's development and release process.

(repo-wide) · high confidence

Sequel plugin for Mobility integration

A new Mobility plugin has been added to the Sequel library. When included in a model, this plugin extends the class with the Mobility module, enabling localized attribute support for Sequel models.

lib/sequel · high confidence

Architecture

Mobility plugins restructured into a modular plugin system

The Mobility library has refactored its internal architecture from a monolithic configuration to a modular plugin system. Core capabilities such as backend management, caching, dirty tracking, fallbacks, and locale accessors are now implemented as distinct, registerable plugins (e.g., \Mobility::Plugins::Cache\, \Mobility::Plugins::Fallbacks\). ORM integrations for ActiveRecord and Sequel are now defined as composite plugins that automatically include the necessary underlying plugins, simplifying setup and allowing for more granular control over which features are enabled.

lib/mobility/plugins · high confidence

Behavioural changes

ActiveRecord backends restructured into explicit plugin classes

The ActiveRecord translation backends (Column, Container, Hstore, Json, Jsonb, KeyValue, PgHash, Serialized, and Table) have been refactored into distinct, explicitly namespaced classes under \Mobility::Backends::ActiveRecord\. This change introduces dedicated Arel node builders for querying JSON/JSONB and Hstore columns, enforces OUTER JOINs by default for Table and KeyValue backends to prevent missing translations in queries, and adds support for compound foreign keys and primary keys other than \:id\ in the Table backend. Additionally, the KeyValue backend now supports configurable association names and class names, while the Serialized backend handles Ruby 7.1+ serialization coder arguments correctly.

_lib/mobility/backends/active\record · high confidence

ActiveRecord plugins restructured as modular components with enhanced query and dirty tracking

The ActiveRecord integration has been refactored into a plugin-based architecture, moving backend, cache, column fallback, dirty tracking, query, and uniqueness validation logic into distinct, registerable modules under \Mobility::Plugins::ActiveRecord\. This change introduces a new \Query\ plugin that enables querying translated attributes using \where\, \order\, \select\, \group\, and \pluck\ via a \VirtualRow\ DSL, and fixes broken \count\ statements in ActiveRecord 8.0 by filtering aliased columns. The \Dirty\ plugin now dynamically defines persistence-specific methods (like \saved\_change\_to\_title?\) and patches \saved\_changes\ and \has\_changes\_to\_save?\ to include mobility mutations. Additionally, a new \ColumnFallback\ plugin allows falling back to original columns for specific locales, and the \UniquenessValidation\ plugin has been updated to correctly handle uniqueness checks on translated attributes using the new query infrastructure.

_lib/mobility/plugins/active\record · high confidence

Major architecture overhaul introducing plugin system and Sequel support

Mobility has been refactored from a monolithic structure into a modular plugin-based architecture, significantly changing how the library is configured and extended. The gem now supports Sequel ORM alongside ActiveRecord, with both treated as optional plugins rather than hard dependencies. Configuration is centralized via a new \Mobility.configure\ block that manages plugins and backends, replacing the previous global configuration methods. The internal API has shifted: \Mobility::Translates\ is now the core module for extending models, and backends are namespaced under \Mobility::Backends\. This change introduces a more flexible system for defining translations, allowing users to mix and match plugins like fallbacks or dirty tracking, but requires updating existing code to use the new configuration and plugin registration patterns.

lib · high confidence

Mobility backends refactored into modular plugins and shared components

The backend implementation in lib/mobility/backends has been restructured to replace the previous plugin system with a modular architecture. Shared logic for storage strategies (such as column, container, hash, hstore, json, jsonb, key\_value, serialized, and table backends) has been extracted into reusable modules within the Backends namespace, while ORM-specific querying and scope application (Arel for ActiveRecord, Op for Sequel) have been moved into dedicated plugins. This change introduces new configuration options like column\_prefix/column\_suffix for hash-valued backends, requires explicit type options for the KeyValue backend, and standardizes backend registration and caching behavior across all storage types.

lib/mobility/backends · high confidence

Mobility library refactored to a plugin-based architecture with new versioning

The Mobility library has been significantly refactored to support a modular plugin system, replacing the previous configuration model. Core components like backends and plugins are now registered explicitly via \Mobility::Backends\ and \Mobility::Plugins\, allowing for better dependency management and extensibility. The \Mobility::Pluggable\ class serves as the abstract parent for translation modules, enabling plugins to declare dependencies and defaults. This change introduces a new versioning scheme (bumping to 1.3.2) and restructures the internal API, which may affect how backends and plugins are configured and loaded.

lib/mobility · high confidence

Rails generators reorganized with ActiveRecord migration compatibility

The Mobility Rails generators have been restructured into the lib/rails/generators/mobility directory and now include an ActiveRecord migration compatibility module that automatically detects the current ActiveRecord version to generate the correct migration class syntax. The install generator has been updated to use this compatibility layer for creating translation table migrations, while the translations generator continues to support table and column backends with improved handling of backend options and invocation logic.

lib/rails/generators/mobility · high confidence

Restructured backend generators and added index name truncation

The Mobility gem's Rails generators have been reorganized into the \lib/rails/generators/mobility/backend\_generators\ directory, introducing a new \Base\ generator class that handles migration creation and template resolution. A key behavioral change is the addition of automatic index name truncation in the \Base\ generator; if a generated index name exceeds the database's length limit, it is now hashed using SHA1 and truncated to fit, preventing migration errors on databases with strict index name constraints. The \TableBackend\ generator has also been updated to correctly derive the translation table name and foreign key from the model, ensuring generated migrations align with the expected schema structure.

_lib/rails/generators/mobility/backend\generators · high confidence

Sequel backends refactored into modular plugin classes

The Mobility library has restructured its Sequel integration by replacing the previous monolithic backend implementations with distinct, modular backend classes (Column, Container, Hstore, Json, Jsonb, KeyValue, PgHash, Serialized, and Table). This change introduces specific backends for PostgreSQL JSON/JSONB and Hstore types, allowing users to store translations in native database hash or JSON columns rather than only in dedicated translation tables or serialized columns. The KeyValue backend now requires the cache plugin to track changes, and the Table backend defaults to OUTER joins for queries, improving compatibility and query performance for Sequel models.

lib/mobility/backends/sequel · high confidence

Sequel integration refactored into modular plugins

The Sequel backend has been restructured from a monolithic implementation into a set of distinct, opt-in plugins (backend, cache, column\_fallback, dirty, and query). This change introduces a new plugin-based architecture where features like dirty tracking and locale-specific querying are enabled explicitly via configuration options rather than being globally active. Users benefit from a cleaner separation of concerns, reduced overhead when specific features are not needed, and a more consistent API for querying translated attributes through the new Query plugin.

lib/mobility/plugins/sequel · high confidence

Switched development console to pry-byebug

The development console (bin/console) now uses pry-byebug instead of the standard IRB, providing an enhanced interactive debugging experience with better stack traces and breakpoint support for developers.

bin · high confidence

Updated Rails generator templates for Mobility v1.0 compatibility

The Rails generator templates for creating translation tables and the initial configuration have been updated to align with Mobility v1.0. The migration templates now use polymorphic references for associations, enforce consistent null constraints, and adjust indexing strategies (such as including locale in indexes for the table backend and truncating index names for the column backend). The initializer template has been restructured to explicitly include the backend\_reader plugin, mention the attribute\_methods plugin, and provide updated examples for fallbacks and column fallbacks, ensuring generated code works correctly with the new library version.

lib/rails/generators/mobility/templates · high confidence

Updated shioyama certificate

The shioyama certificate has been replaced with a new version. This update changes the certificate's validity period, public key material, and associated identity details, which may affect systems relying on the previous certificate for authentication or verification.

certs · high confidence

Test coverage

Add ActiveRecord test schema for multiple storage backends; Add shared test suites for translated attribute backends; Added Sequel test schema with support for JSONB, JSON, and Hstore backends; Added comprehensive test coverage for ActiveRecord translation backends; Added comprehensive test coverage for Mobility plugin system; Added comprehensive test coverage for Sequel translation backends; Added custom RSpec matchers for testing; Added generator specs for install and translations generators; Added integration tests for ActiveRecord and Sequel compatibility; Added performance tests for Mobility::Translations; Added specs for ActiveRecord, Sequel, Hash, and KeyValue backends; Added test coverage for Mobility core components; Added test coverage for Sequel plugins; Added test coverage for new ActiveRecord plugin structure; Added tests for Active Model cache and dirty tracking plugins; Added tests for the Sequel Mobility plugin; Centralized test helpers for backend and plugin testing; Expanded test suite with ORM/database infrastructure and locale behavior coverage.

Dependencies

Mobility v1.3.0 release with expanded ORM support and gem signing

This update releases Mobility v1.3.0, introducing a dynamic Gemfile that allows testing against ActiveRecord 7.0–8.1 and Sequel 5.x via environment variables, alongside specific dependency pinning for concurrent-ruby and sqlite3. The gemspec now enforces Ruby \>= 2.5, adds runtime dependencies on request\_store and i18n, and includes metadata for source code and bug trackers. Additionally, the gem is now signed with a certificate chain, and a post-install warning alerts users to potential backwards-incompatible changes in jsonb/hstore backends.

(dependencies) · 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 66.

Lenses

  • Code Health 98
  • Architecture 100
  • Maturity 52
  • Readiness 63
  • Security 84
  • Domain Modelling 100

Changes since last survey

  • 300 commits — 261 feature/other, 39 fixes

By area

  • lib/mobility — 122 commits
  • (root) — 94 commits
  • spec/mobility — 34 commits
  • .github/workflows — 15 commits
  • lib/mobility.rb — 10 commits
  • lib/rails — 7 commits
  • certs/shioyama.pem — 3 commits
  • spec/mobility_spec.rb — 3 commits
  • spec/spec_helper.rb — 3 commits
  • (repo) — 2 commits
  • spec/generators — 2 commits
  • benchmarks/overhead.rb — 1 commit
  • spec/database.rb — 1 commit
  • spec/integration — 1 commit
  • spec/performance — 1 commit
  • spec/support — 1 commit

Notable commits

  • fix: Add failing regression spec for #513
  • fix: Add regression test for #513 with select
  • fix: Fix Mobility::Attributes#inspect and add specs
  • fix: Fix NoMethodError: undefined method `mobility_backend_class' for nil
  • fix: Fix Ruby 2.7.0 Deprecation Warnings
  • fix: Fix Sequel plugin spec
  • fix: Fix Sequel spec failures
  • fix: Fix Seuqel container op in Sequel
  • fix: Fix broken count statements in ActiveRecord 8.0
  • fix: Fix broken spec
  • fix: Fix broken version
  • fix: Fix builds with ActiveRecord 7.0
  • fix: Fix changelog
  • fix: Fix changelog message
  • fix: Fix changelog titles
  • fix: Fix duping with AR KeyValue backend cache
  • fix: Fix failing test
  • fix: Fix fallback syntax in initializer example
  • fix: Fix fallbacks performance regression
  • fix: Fix for Rails 8 issue with select + count
  • …and 280 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

shioyama/mobility 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 337f32d30a61b97f3b3aa1c315e92ad0fa933c51 — 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.