possibly better fix for ordering pools by category

This commit is contained in:
Toks
2013-05-15 01:09:18 -04:00
parent fb4ce9a13b
commit 633bc8cb31
2 changed files with 6 additions and 5 deletions

View File

@@ -29,6 +29,10 @@ class Pool < ActiveRecord::Base
where("category = ?", "collection")
end
def series_first
order("(case category when 'series' then 0 else 1 end), name")
end
def search(params)
q = scoped
params = {} if params.blank?