add upvote and downvote metatags
This commit is contained in:
@@ -348,6 +348,18 @@ class PostQueryBuilder
|
||||
end
|
||||
end
|
||||
|
||||
if q[:upvote].present?
|
||||
user_id = q[:upvote]
|
||||
post_ids = PostVote.where(:user_id => user_id).where("score > 0").limit(400).pluck(:post_id)
|
||||
relation = relation.where("posts.id in (?)", post_ids)
|
||||
end
|
||||
|
||||
if q[:downvote].present?
|
||||
user_id = q[:downvote]
|
||||
post_ids = PostVote.where(:user_id => user_id).where("score < 0").limit(400).pluck(:post_id)
|
||||
relation = relation.where("posts.id in (?)", post_ids)
|
||||
end
|
||||
|
||||
if q[:ordfav].present?
|
||||
user_id = q[:ordfav].to_i
|
||||
user = User.find(user_id)
|
||||
|
||||
@@ -12,7 +12,7 @@ module Reports
|
||||
User.find(user_id)
|
||||
end
|
||||
|
||||
def prime_similar_users(endpoint = "user_similarity")
|
||||
def prime(endpoint = "user_similarity")
|
||||
10.times do
|
||||
result = fetch_similar_user_ids(endpoint)
|
||||
if result == NOT_READY_STRING
|
||||
|
||||
Reference in New Issue
Block a user