I am using a rails app with neo4j database, recently I had updated Neo4j server from v 2.x to 3.x and the gem neo4j from 7.x to 8.x . Having these models in my app:
class Country
include Neo4j::ActiveNode
property :summary, type: String
property :code, type: String
has_many :out, :provinces, type: :placed, model_class: :Province
end
class Province
include Neo4j::ActiveNode
property :summary, type: String
property :code, type: String
has_one :in, :country, type: :placed, model_class: :Country
end
when I try to do a query in this way:
Neo4j::Core::Query.new.match(p: Province, c: Country).match("(c)-[PLACED]->(p)").order_by('p.summary').return(:p).pluck(:p)
I retrieve this error:
Neo4j::Core::Query.new.match(p: Province, c: Country).match("(c)-[PLACED]->(p)").order_by('p.summary').return(:p).pluck(:p)
NoMethodError: undefined method `_query' for nil:NilClass
and in the same way for the other similar queries performed by Neo4j::Core::Query class.
What i am doing wrong?