Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: a8e679d9ac
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (12 sloc) 0.359 kB
class SearchEngine
# How many results should we show per page
RESULTS_LIMIT = 10
# Perform search over the specified models
def self.search(query, page = 1)
results = []
Refinery.searchable_models.each do |model|
results << model.limit(RESULTS_LIMIT).with_query(query)
end if query.present?
results.flatten[0..(RESULTS_LIMIT - 1)]
end
end
Jump to Line
Something went wrong with that request. Please try again.