remiprev/her — pull request #277 by kinopyo (2014-08-08 10:46:17+00:00)
Title: Cache subsequent calls with parameters when accesssing assosiation objects

### Changes

Change `@cached_result` type to a Hash, and use `@params` as hash key to store the value.

Based on this pull request: https://github.com/remiprev/her/issues/248

### Real World Example

When I apply pagination parameter to the association objects, I found that the request was not cached and will be triggered every time it's been called.

```ruby
@posts = @user.posts.where(page: params[:page])

@posts # => Fire a request
@posts # => Fire a request
@posts # => Fire a request
```

By using memcache the requests will still be sent, even though since 2nd time memcache will return the cached value.

---

Not sure if it has any undesirable side effect, I've checked that all specs are passed on my local.