neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.39k stars 276 forks source link

Associations nested with parent-child #1623

Closed EnziinSystem closed 3 years ago

EnziinSystem commented 3 years ago

Hello, I am a newbie with neo4jrb. I want to associations nested Category parent-child, but I not sure. I think need parent_id. Please help me!

class Category
  include ActiveGraph::Node
  property :title, type: String
  property :content, type: String
  property :type, type: String

  has_many :in, :children, type: :INCLUDES, model_class: :Category
  has_one :out, :parent, type: :BELONGS_TO, model_class: :Category
end
klobuczek commented 3 years ago

gitter is the right place for questions like this.