n8 / multi_fetch_fragments

Multi-fetch Fragments makes rendering and caching a collection of template partials easier and faster.
http://ninjasandrobots.com/rails-faster-partial-rendering-and-caching
MIT License
539 stars 63 forks source link

Fix custom cache key mechanism for shorthand syntax #35

Open shreve opened 7 years ago

shreve commented 7 years ago

According to the docs, multi_fetch_fragments supports the shorthand syntax, render @items, cache: true. This is true for boolean values, but does not support custom cache keys via proc or lambda values. This is because the shorthand passes cache to @locals rather than @options, and the search for the callable object is limited to @options.

This commit adds @locals to that search.