This commit is contained in:
Toks
2013-05-17 10:17:16 -04:00
parent cac44403e2
commit bbf2181f4d
2 changed files with 7 additions and 2 deletions

View File

@@ -49,8 +49,13 @@ class Pool < ActiveRecord::Base
q = q.where("is_active = false")
end
if params[:sort] == "name"
case params[:sort]
when "name"
q = q.order("name")
when "created_at"
q = q.order("created_at desc")
when "post_count"
q = q.order("post_count desc")
else
q = q.order("updated_at desc")
end