Adjust minimum reaction count on follower suggestion

This commit is contained in:
Ben Halpern 2018-03-22 19:37:12 -04:00
parent ccbbe334fe
commit 7fab7e99f1

View file

@ -33,7 +33,7 @@ class UserFollowSuggester
Article.
tagged_with(user.decorate.cached_followed_tag_names, any: true).
where(published: true).
where("positive_reactions_count > ?", 1).pluck(:user_id).
where("positive_reactions_count > ?", article).pluck(:user_id).
each_with_object(Hash.new(0)) { |value, counts| counts[value] += 1 }.
sort_by { |_key, value| value }.
map { |arr| arr[0] }
@ -42,4 +42,8 @@ class UserFollowSuggester
def offset_number
Rails.env.production? ? 250 : 0
end
end
def article
Rails.env.production? ? 15 : 0
end
end