This commit is contained in:
r888888888
2013-07-26 16:50:42 -07:00
parent a6329174c4
commit 8cc05f5ef6

View File

@@ -276,8 +276,6 @@ class PostQueryBuilder
if q[:order] == "rank"
relation = relation.where("posts.score > 0 and posts.created_at >= ?", 2.days.ago)
elsif q[:order] == "rank2"
relation = relation.where("posts.fav_count > 0 and posts.created_at >= ?", 2.days.ago)
elsif q[:order] == "landscape" || q[:order] == "portrait"
relation = relation.where("posts.image_width IS NOT NULL and posts.image_height IS NOT NULL")
end
@@ -336,9 +334,6 @@ class PostQueryBuilder
when "rank"
relation = relation.order("log(3, posts.score) + (extract(epoch from posts.created_at) - extract(epoch from timestamp '2005-05-24')) / 45000 DESC")
when "rank2"
relation = relation.order("log(3, posts.fav_count) + (extract(epoch from posts.created_at) - extract(epoch from timestamp '2005-05-24')) / 45000 DESC")
else
relation = relation.order("posts.id DESC")
end