Open cheerfulstoic opened 9 years ago
I would really love to see something like this:
class Category include Neo4j::ActiveNode has_many :in, :parent, model_class: :Category, type: :HAS_CATEGORY has_many :out, :children, model_class: :Category, type: :HAS_CATEGORY end root_categories = Category.roots.deeply_with_association(:children, 5) # `root` scope not defined above root_category = root_categories[0] # Cypher query! root_category.children # No cypher query! root_category.children[0].children[0].children[0] # No cypher queries!
Talk amoungst yourselves
+1 I would even go a step further: .deeply_with_association(:parent, :any) To eagerly retrieve everything of arbitrary depth (of course to be used responsibly).
.deeply_with_association(:parent, :any)
I would really love to see something like this:
Talk amoungst yourselves