You might want to read the upgrade guide before reading the rest of this answer.
The rels
relationship was not added to the Neo4j::Core::Node
objects which replaced the old Node
objects in the old API. I believe we also had a rels
method in ActiveNode
.
If you are using ActiveNode
, the replacement is to define an association. Something like:
class Student
include Neo4j::ActiveNode
has_many :out, :all_nodes, type: :enrolled_in, model_class: false
end
# Then you can do:
student.all_nodes.count
However the fact that you're only following the enrolled_in
relationship makes me think that this might be going to specific nodes (maybe Course
?). If so I'd suggest doing:
class Course
include Neo4j::ActiveNode
end
class
include Neo4j::ActiveNode
has_many :out, :courses, type: :enrolled_in
# model_class of `Course` will be assumed based on the association's name
end
If you aren't using ActiveNode
but rather the neo4j-core
gem directly, you should use a Cypher query