# active-hash/active_hash

A readonly ActiveRecord-esque base class that lets you use a hash, a Yaml file or a custom file as the datasource

Repository: https://github.com/active-hash/active_hash
Canonical: https://ross.abutalabs.com/products/active_hash
Language: Ruby
License: MIT
License Family: permissive
Last push: 2026-07-21T17:30:17+00:00

## Health v2 (maintenance only)
Score: 78/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 45, longevity 100
- inputs: {"age_days": 6252, "days_push": 43, "days_rel": 155, "gap_med": 244, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1354, forks 187 (observed 2026-08-28T04:04:29.093161+00:00)

## What it is
A Ruby gem providing an ActiveRecord-like base class backed by in-memory hashes, YAML files, or custom file data sources instead of a database. It supports ActiveRecord-style associations like has_many and belongs_to, letting static data models drop into Rails apps seamlessly.

## Use cases
- use static lookup data like countries in Rails forms without a database
- replace ActiveRecord models with hash-backed models for seed or reference data
- test gems or plugins that rely on ActiveRecord behavior without a database
- load model data from YAML files instead of a database table
- seamlessly upgrade hash-backed models to full ActiveRecord models later

## When to choose
- you have small, static, readonly datasets in a Rails app
- you want ActiveRecord-like APIs for data that lives in hashes or YAML files
- you need database-free models for fast test suites

## When to avoid
- you need writable, persistent data with queries across large datasets
- your data changes at runtime and must be stored in a real database
- you are not working in Ruby or a Rails-compatible environment

## Facets
- artifact type: library
- maturity: active
- function: orm, database, serialization
- domain: web-development, backend, developer-tools, testing
- platform: ruby, jvm
- tags: activerecord, yaml, in-memory-data, rails, readonly-models, fixtures

## Member repositories
- active-hash/active_hash (main) score 78

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:29.093161+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:42:00.684784+00:00, confidence not recorded.
  - readme: https://github.com/active-hash/active_hash (fetched 2026-08-28T04:04:29.093161+00:00, sha 93533f1ef38e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
