Organise ActiveRecord model into a tree structure
06-Aug-2020 1511
Ancestry is a gem that allows the records of a Ruby on Rails ActiveRecord model to be organised as a tree structure (or hierarchy). It employs the materialised path pattern and exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants), allowing all of them to be fetched in a single SQL query. Additional features include STI support, scopes, depth caching, depth constraints, easy migration from older gems, integrity checking, integrity restoration, arrangement of (sub)trees into hashes, and various strategies for dealing with orphaned records.
Organise ActiveRecord model into a tree structure #ruby #rubydeveloper #rubyonrails #Organise #ActiveRecord #model #structure #activerecord https://rubyonrails.ba/link/organise-activerecord-model-into-a-tree-structure