Created
November 15, 2011 17:56
-
-
Save jgarber/1367789 to your computer and use it in GitHub Desktop.
Fetching most popular items in the last seven days using charlotte-ruby/impressionist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Impression.where("created_at>=? and created_at<=?",7.days.ago,Time.now).select("impressionable_id").group("impressionable_id").order("count_impressionable_id DESC").limit(7).count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment