A nice shortcut for group count queries

A nice shortcut for group count queriesVisit.top(:browser)instead ofVisit.group(:browser).where("browser IS NOT NULL").order("count_all DESC, browser").countBe sure to sanitize user input like you must with groupAlso works with arrays and hashes["up", "up", "down"].top(1).
A nice shortcut for group count queries #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper

Nezir Zahirovic

Freelance software developer Ruby On Rails (4 years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles