airbnb/rendr — pull request #153 by growlypants (2013-10-17 22:33:11+00:00)
Title: Model store find

Hey AirBnB, it's me again.

I'm not finished with this pull request yet (testing and such), but it could be seen as a big change, so I wanted to get it to you asap.

The problem is this:

If I have a fetch spec that looks like:
```js
spec = {model: {model: 'Artist', params: {id: params.id}}}
```
I'm good to go. The fetcher will read and write from cache no problem. Even if I use a different idAttribute.

However let's say my fetch spec looks like:
```js
spec = {model: {model: 'Artist', params: {name: 'Pendulum'}}}
```
The fetcher does not know how to read and write this spec to cache.

In my opinion, it's highly unlikely that the database will ever return a different object, considering it's returning just a single model. If I was expecting a different object, I'd either put a cache time in (supported in MemoryStore), or set "readFromCache" or "writeToCache" to false in the fetch options.

This allows the fetcher to store models based on any arbitrary object.

I hope this makes sense. If so, please enjoy this photo of two guinea pigs wearing hats.
![Guinea Pigs Wearing Hats](http://4.bp.blogspot.com/_oJpV6yalpOk/TQioeS6UWiI/AAAAAAAAATY/d-gMnfFpi1Y/s1600/The-best-top-desktop-guinea-pig-wallpapers-3.jpg)