Adds a basic cache_key
method to ActiveRecord::Base
subclasses for easy collection fragment caching.
Add this line to your application's Gemfile:
gem 'collection_cache_key', '~> 1.0'
And then execute:
$ bundle
<% cache MyModel do %>
<% MyModel.all.each do |m| %>
...
<% end %>
<% end %>
- Fork it ( https://github.com/freego/collection_cache_key/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request