stefankroes/ancestry
Organise ActiveRecord model into a tree structure observed · 2026-08-28
Health v2 · maintenance only
72/100
- Activity 89
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 6165
- days_rel: n/a
- days_push: 70
- n_releases_24m: 0
Adoption not part of the score
3880 stars · 473 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A Ruby gem that organizes Rails ActiveRecord models into tree (hierarchical) structures using the materialized path pattern. It stores the ancestor chain in a single column, enabling efficient single-query traversal of ancestors, descendants, siblings, and children without extra tables.
Use cases
- organize ActiveRecord models into a tree hierarchy
- query ancestors and descendants of a record efficiently
- build category or comment nesting in Rails
- manage parent-child relationships in a single database table
- move nodes in a hierarchy without rewriting the whole tree
- add depth caching and counter caches to hierarchical data
When to choose
- you use Rails/ActiveRecord and need hierarchical data in an existing table
- you want fast single-query tree reads with a btree index
- you want to avoid extra join tables for tree storage
- you need STI support or orphan-handling strategies for tree nodes
When to avoid
- you use a non-Ruby ORM or non-ActiveRecord stack
- you need graph structures with many-to-many relationships rather than trees
- you prefer adjacency-list or nested-set patterns with existing tooling
- your project does not use a relational database supported by ActiveRecord
Facets
library · maturity stable
orm database developer-tools databases web-development backend developer-tools ruby jvm activerecord rails tree-structure hierarchy materialized-path gem
1 source
- readme: https://github.com/stefankroes/ancestry · fetched 2026-08-28 · c48c5956249f
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| stefankroes/ancestry | main | 72 |
For agents
markdown · JSON · MCP: product_card(name="stefankroes/ancestry")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem