improved legacy tag api compat

This commit is contained in:
albert
2013-02-22 14:47:42 -05:00
parent ae6e8fce30
commit 702d5002f7

View File

@@ -417,7 +417,19 @@ class Tag < ActiveRecord::Base
q = q.where("post_count > 0")
end
case params[:sort].present?
if params[:limit].present?
q = q.limit(params[:limit].to_i)
end
case params[:order]
when "date"
q = q.order("created_at desc")
else
q = q.order("name")
end
case params[:sort]
when "count"
q = q.order("post_count desc")