Sha256: d29091477f3ebfce2233a0e2fa7c440fe220c3f039f79cb6e4a772ef59594cf4

Contents?: true

Size: 324 Bytes

Versions: 2

Compression:

Stored size: 324 Bytes

Contents

class Search < ActiveRecord::Base
  
  def self.get_most_frequent_searches
    frequent_searches = []
    Search.all(:select => "query, count(query) as query_count", :group => "query", :order => "query_count DESC", :limit => 7).each do |row|
      frequent_searches << row[:query]
    end
      frequent_searches
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quick_search-core-0.0.1 app/models/search.rb
quick_search-core-0.0.1.test app/models/search.rb