activerecord-summarize (rubygems): Just wrap your existing code in `@relation.summarize do |relation| ... end` and run your queries against relation instead of @relation.
Keywords: activerecord|rails|ruby|ruby-gem|ruby-on-rails