This commit is contained in:
Toks
2013-08-27 22:24:07 -04:00
parent adbe269aea
commit 1b31961184
3 changed files with 11 additions and 1 deletions

View File

@@ -274,6 +274,10 @@ class PostQueryBuilder
relation = add_tag_string_search_relation(q[:tags], relation)
if q[:ordfav].present?
relation = relation.joins(:favorites).where("favorites.user_id = ?", q[:ordfav].to_i).order("favorites.id DESC")
end
if q[:order] == "rank"
relation = relation.where("posts.score > 0 and posts.created_at >= ?", 2.days.ago)
elsif q[:order] == "landscape" || q[:order] == "portrait"