I’m trying to make objects belong to other objects of the same class by adding a parent_id attribute to the object so active record can associate them with each other in a hierarchical manner.
I know I can just write an instance method to do a find and get them, but I want to know if there is a more rails appropriate way to accomplish this, so can I set this up with active record associations, if so how?
It seems that this gem may be of help :
https://github.com/skyeagle/nested_set
or acts_as_tree:
https://github.com/rails/acts_as_tree