# RailsCacheIt Help you easy to cache with ActiveRecord. Only support Rails program. ## Installation Add this line to your application's Gemfile: gem 'rails_cache_it' And then execute: $ bundle Or install it yourself as: $ gem install rails_cache_it ## Usage ###cache `User.limit(50).cache_it` Only work on Relation now(it means you can't use it with #first #last etc..). ###expires `User.limit(50).cache_it expires_in: 5.minutes` or use block `User.limit(50).cache_it{ User.count}` when block.call != pre_block.call cache will expires ###allowed options view [AvtiveSupport::Cache::Store#fetch](http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-fetch) ###set default options `RailsCacheIt.default_options.merge!(options)` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request