16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/neo4j/active_node/query/query_proxy_enumerable.rb', line 16
def result(node = true, rel = nil)
@result_cache ||= {}
return result_cache_for(node, rel) if result_cache?(node, rel)
pluck_vars = []
pluck_vars << identity if node
pluck_vars << @rel_var if rel
result = pluck(*pluck_vars)
result.each do |object|
object.instance_variable_set('@source_query_proxy', self)
object.instance_variable_set('@source_proxy_result_cache', result)
end
@result_cache[[node, rel]] ||= result
end
|