Skip to content

Commit

Permalink
Ignore indexes ftw. Secretz page now actually loads.
Browse files Browse the repository at this point in the history
  • Loading branch information
sudara committed Sep 13, 2011
1 parent fa452e9 commit 3172629
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/listen.rb
Expand Up @@ -82,8 +82,11 @@ def self.most_active_ips(limit=25)
Listen.count(:all, :group => :ip, :conditions => ['created_at > ?',30.days.ago], :order => 'count_all DESC', :limit => limit)
end

def self.most_active_tracks(limit=25)
Listen.count(:all, :group => :asset, :conditions => ['created_at > ?',30.days.ago], :order => 'count_all DESC', :limit => limit)
def self.most_active_tracks(limit=10)
Listen.count(:all,
:from => "listens IGNORE INDEX(index_listens_on_asset_id)",
:group => :asset,
:conditions => ['created_at > ?',30.days.ago], :order => 'count_all DESC', :limit => limit)
end

def self.find_user_by_ip(ip)
Expand Down

0 comments on commit 3172629

Please sign in to comment.