This is rails gem which will minimize query for one-to-one, one-to-many database relationships. Minimize query by query_optimizer just pass your table name as Post.optimize_query(:comments)
Add this line to your application's Gemfile:
gem 'query_optimizer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install query_optimizer
Refer https://github.com/akshaygoyal88/query_optimizer/blob/master/README.rdoc for usage
- Fork it ( https://github.com/akshaygoyal88/query_optimizer/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 a new Pull Request