lib/neo4j/active_node/query.rb in neo4j-3.0.1 vs lib/neo4j/active_node/query.rb in neo4j-3.0.2
- old
+ new
@@ -15,21 +15,13 @@
# mike.query_as(:mike).match('mike-[:friend]-friend').return(friend: :name)
#
# @param var [Symbol, String] The variable name to specify in the query
# @return [Neo4j::Core::Query]
def query_as(var)
- self.class.query_as(var).where("ID(#{var}) = #{self.neo_id}")
+ self.class.query_as(var).where("ID(#{var})" => self.neo_id)
end
module ClassMethods
- include Enumerable
-
- #attr_writer :query_proxy
-
- def each
- self.query_as(:n).pluck(:n).each {|o| yield o }
- end
-
# Returns a Query object with all nodes for the model matched as the specified variable name
#
# @example Return the registration number of all cars owned by a person over the age of 30
# # Generates: MATCH (person:Person), person-[:owned]-car WHERE person.age > 30 RETURN car.registration_number
# Person.query_as(:person).where('person.age > 30').match('person-[:owned]-car').return(car: :registration_number)