Fetching ancestors/sibling records per locale in ActiveRecord
Context There are times when we need to work with parent records within our database.
A practical example we will use today is Pages table with a parent_id column, referencing another Page record.
This will be used in building page breadcrumbs(parents) and fetching recommended pages(siblings).
pizza_recipe_page = Page.last recipes_page = pizza_recipe_page.parent This builds up a tree like structure, and we would most probably need a way to fetch the page
ramblingcode.dev