Skip to content
CAI
Software that uses CAICheck a score

cgriego/active_attr

65.9

Adequate · 20 September 2026

1.5k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

ActiveAttr is a Ruby library that provides lightweight model functionality, including attribute definition, typecasting, mass assignment, and serialization, without requiring a full ORM. It offers a dedicated typecasting subsystem for standard data types and RSpec matchers to facilitate testing of attribute definitions. The system is designed for broad compatibility, supporting Rails versions from 3.0 through 8.1 and utilizing lazy autoloading to optimize startup performance.

Features

Add RSpec/Shoulda matcher for verifying ActiveAttr attributes

Introduces the \have\_attribute\ matcher for RSpec and Shoulda, allowing tests to verify that a model has a specific attribute with optional constraints on type (via \.of\_type\) and default value (via \.with\_default\_value\_of\). The matcher checks for the presence of required ActiveAttr modules (such as \ActiveAttr::Attributes\, \ActiveAttr::TypecastedAttributes\, and \ActiveAttr::AttributeDefaults\) and provides detailed failure messages comparing expected versus actual attribute definitions.

_lib/active\attr/matchers · high confidence

New dedicated typecaster classes for standard data types

The typecasting subsystem now includes specific, isolated classes for handling conversion to Boolean, Date, DateTime, BigDecimal, Float, Integer, Object, and String. Each class encapsulates the logic for its target type (e.g., BooleanTypecaster handles YAML-style false values and nil/empty strings, while BigDecimalTypecaster prefers \#to\_d), replacing or supplementing previous monolithic or regex-based approaches with more maintainable, single-responsibility components.

_lib/active\attr/typecasting · high confidence

Behavioural changes

Introduces autoloading for ActiveAttr modules

ActiveAttr now uses ActiveSupport::Autoload to lazily load its modules (such as AttributeDefaults, Attributes, BasicModel, and Serialization) instead of requiring them all upfront. This change improves startup performance by only loading the specific features your application actually uses, while maintaining backward compatibility with existing code.

lib · high confidence

Test coverage

Added functional test suite for ActiveAttr components; Added functional tests for HaveAttributeMatcher; Added test support files and updated ActiveModel lint to use Minitest; Added unit tests for ActiveAttr core modules; Added unit tests for ActiveAttr typecasting components; Split test suite into unit and functional categories; Updated RSpec configuration and added ActiveModel version filtering.

Dependencies

Expanded test support for Rails 3.0 through 8.0 and Rails HEAD

The gemfiles directory now includes dedicated dependency configurations for Rails versions 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0, 7.1, 7.2, and 8.0, as well as a configuration for the Rails main branch. These files pin specific versions of activemodel, activesupport, and actionpack to match the target Rails release, and include necessary test dependencies such as protected\_attributes\_continued, activemodel-serializers-xml, rexml, and factory\_bot (with version constraints for older Ruby versions). The Rails HEAD configuration pulls dependencies directly from the main branches of the Rails and Rack repositories.

gemfiles · high confidence

Update dependencies for Rails 8.1 support and modernize gemspec

ActiveAttr now supports Rails 8.1 by updating its runtime dependencies to allow ActionPack, ActiveModel, and ActiveSupport versions \>= 3.0.2 and \< 8.2. The gemspec has been modernized to include an MIT license, a changelog URI, and updated author information. Development dependencies have been refreshed, including a switch to factory\_bot, an update to RSpec \~\> 3.0, and the addition of byebug and yard, while the Gemfile source has been updated to use HTTPS.

(dependencies) · high confidence

Housekeeping

ActiveAttr version bump to 0.17.2

The library version has been updated from 0.0.1 to 0.17.2. This change reflects the cumulative state of the library, which includes features such as attribute defaults, typecasting, mass assignment, and serialization, but the diff itself only modifies the version constant.

_lib/active\attr · 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 100
  • Architecture 100
  • Maturity 48
  • Readiness 65
  • Security 100

Changes since last survey

  • 300 commits — 257 feature/other, 43 fixes

By area

  • (root) — 151 commits
  • lib/active_attr — 82 commits
  • spec/functional — 18 commits
  • spec/unit — 14 commits
  • (repo) — 13 commits
  • .github/workflows — 9 commits
  • spec/support — 4 commits
  • gemfiles/rails_head.gemfile — 3 commits
  • lib/active_attr.rb — 2 commits
  • spec/spec_helper.rb — 2 commits
  • gemfiles/rails_3_0.gemfile — 1 commit
  • gemfiles/rails_3_1.gemfile — 1 commit

Notable commits

  • fix: Add Slides and RailsCast to README, fixes #107 [ci skip]
  • fix: Attributes#inspect is now filtered based on filtered_attributes [fixes #170]
  • fix: Backport ActiveModel 3.2 fix
  • fix: Change spec to force execution order to workaround bug in 1.8 with dynamically defined classes, closes #49
  • fix: Changed Typecasting::BooleanTypecaster to cast nil and empty strings to false, fixes #139
  • fix: Changed Typecasting::DateTypecaster to raise on invalid Strings, fixes #106
  • fix: Doc typo fix [ci skip]
  • fix: Fix CHANGELOG [ci skip]
  • fix: Fix DST bug in DateTimeTypecaster specs
  • fix: Fix FactoryBot warnings
  • fix: Fix REE build
  • fix: Fix RSpec deprecation warnings in the ActiveAttr specs
  • fix: Fix Rails HEAD build
  • fix: Fix Ruby 2.0.0 build
  • fix: Fix Ruby warning from spec under 1.9.3
  • fix: Fix Travis config
  • fix: Fix Travis exclusion
  • fix: Fix Travis exclusions
  • fix: Fix all Ruby warnings in ActiveAttr
  • fix: Fix an issue with QueryAttributes and autoloading causing a load error
  • …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

cgriego/active_attr 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 c6ea1e768cfab1a92df9aadd336351ba827c0ae8 — 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.