lib/neo4j/core/query.rb in neo4j-4.1.2 vs lib/neo4j/core/query.rb in neo4j-4.1.3
- old
+ new
@@ -6,14 +6,17 @@
# @param [Symbol] var The variable to be used to refer to the object from within the new QueryProxy
# @param [Boolean] optional Indicate whether the new QueryProxy will use MATCH or OPTIONAL MATCH.
# @return [Neo4j::ActiveNode::Query::QueryProxy] A QueryProxy object.
def proxy_as(model, var, optional = false)
# TODO: Discuss whether it's necessary to call `break` on the query or if this should be left to the user.
- Neo4j::ActiveNode::Query::QueryProxy.new(model, nil, starting_query: self.break, node: var, optional: optional)
+ Neo4j::ActiveNode::Query::QueryProxy.new(model, nil, starting_query: self, node: var, optional: optional, chain_level: @proxy_chain_level)
end
# Calls proxy_as with `optional` set true. This doesn't offer anything different from calling `proxy_as` directly but it may be more readable.
def proxy_as_optional(model, var)
proxy_as(model, var, true)
end
+ #
+ # For instances where you turn a QueryProxy into a Query and then back to a QueryProxy with `#proxy_as`
+ attr_accessor :proxy_chain_level
end
end