neo4jrb/neo4j — pull request #472 by subvertallchris (2014-09-13 23:56:09+00:00)
Title: Association cache

This update caches query results on instances. It only goes one hop deep, so `show.band.shows` wouldn't benefit, but it will cut the number of queries performed in many common situations.

The view below would benefit by having one query for `band.added_by` on each band, then one for `show.venue`. Prior to this, it would do one for each time `band.added_by` is called and then one for each `show.venue`.

```ruby
<% show.bands.each do |band| %>
<%= band.name %>
<%= band.added_by.username %>
<%= band.added_by.email %>
<% end %>

<%= show.venue.name %>
<%= show.venue.address %>
<%= link_to show.venue.name, show.venue %>
```