activegraph icon indicating copy to clipboard operation
activegraph copied to clipboard

has_many method documentation

Open iehdk opened this issue 5 years ago • 1 comments

So the has_many explanation @ https://neo4jrb.readthedocs.io/en/9.2.x/ActiveRel.html could be better, IMHO. Take the example:

class Student
  include Neo4j::ActiveNode
  has_many :out, :lessons, rel_class: :EnrolledIn
end

What is :out ? What is :lessons? What does rel_class accept?

iehdk avatar Sep 12 '18 15:09 iehdk

Starting in the ActiveNode association's section might be easier: https://neo4jrb.readthedocs.io/en/9.2.x/ActiveNode.html#associations.

I've never thought about it before, but the docs might be best read in order.

Also, FYI

  • You need to be familiar with the cypher query language or you're gunna have a bad time. :out is referring to the relation's direction.
  • :lesson is the name used for the created method (having read the ActiveNode association's section, you'd need to figure this out by looking at the usage examples).
  • rel_class accepts the name of an ActiveRel class.

When you figure things out, if you have an idea for how to improve the docs, a PR would be welcomed.

jorroll avatar Sep 12 '18 19:09 jorroll