fixes #1729
This commit is contained in:
@@ -276,8 +276,6 @@ class PostQueryBuilder
|
|||||||
|
|
||||||
if q[:order] == "rank"
|
if q[:order] == "rank"
|
||||||
relation = relation.where("posts.score > 0 and posts.created_at >= ?", 2.days.ago)
|
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"
|
elsif q[:order] == "landscape" || q[:order] == "portrait"
|
||||||
relation = relation.where("posts.image_width IS NOT NULL and posts.image_height IS NOT NULL")
|
relation = relation.where("posts.image_width IS NOT NULL and posts.image_height IS NOT NULL")
|
||||||
end
|
end
|
||||||
@@ -336,9 +334,6 @@ class PostQueryBuilder
|
|||||||
when "rank"
|
when "rank"
|
||||||
relation = relation.order("log(3, posts.score) + (extract(epoch from posts.created_at) - extract(epoch from timestamp '2005-05-24')) / 45000 DESC")
|
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
|
else
|
||||||
relation = relation.order("posts.id DESC")
|
relation = relation.order("posts.id DESC")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user