ancestry
Ancestry allows the records of a ActiveRecord model to be organized in a tree structure, using the materialized path pattern. It exposes the standard relations (ancestors, parent, root, children, siblings, descendants) and allows them to be fetched in a single query. Additional features include named scopes, integrity checking, integrity restoration, arrangement of (sub)tree into hashes and different strategies for dealing with orphaned records.
Types
Docs
Guides
Zeitwerk
Namespace
Optimized
4.1.0
Stefan Kroes and Keenan Brock
bundle add ancestry
Getting Started
Learn more about the Ancestry gem.
Playground
Test, play and inspect the gem for yourself