Welcome to the sixth episode in a series of short screencasts about the Ruby neo4j gem. Previously we learned how to chain associations together to create queries which can hop across entities and use any part of the entire path to query records of interest. In this episode we dig deeper into the tools behind the magic. A familiarity with the Cypher query language is advised. See the show notes for a link to a Cypher tutorial.
As discussed previously, when we call associations we get a proxy object:
user.created_assets
There are two kinds of proxy objects: AssociationProxy and QueryProxy. The details aren't important for the moment, but behind the scenes both are causing a Query object to be built. We can see this Query object by calling the query method at any point:
user.created_assets.query