Learn more about the Schools App with our Weekly Wednesday Webinar!

Posts Tagged ‘SQL’

Finding the Biggest Group

Finding the Biggest Group

An interesting undocumented piece of ActiveRecord I bumped into today is “count_all”. You can use this inside ActiveRecord count calls to do sorts and limits based on the count when you’re doing GROUP BY. I came across this because I was having a bit of trouble recently finding the Rails way to find the biggest [...]