Instantly share code, notes, and snippets.
Note the multi-valued pluck is a Rails 4 feature, Rails 3 will need something slightly different
This is similar to Caching with Rails guide cache_key_for_products method, isn't it ?
Or i'ts more optimized ?
For Rails 3 you need a little bit more code:
sql = select('COUNT(*), MAX(updated_at)').to_sql