Add reaction score to article hotness score
This commit is contained in:
commit
ab4b4fba6e
3 changed files with 13 additions and 5 deletions
|
|
@ -1,8 +1,9 @@
|
|||
class BlackBox
|
||||
def self.article_hotness_score(article)
|
||||
return (article.featured_number|| 10000)/10000 unless Rails.env.production?
|
||||
reaction_points = article.reactions.sum(:points)
|
||||
FunctionCaller.new("blackbox-production-articleHotness",
|
||||
{article: article, user: article.user}.to_json).call
|
||||
{article: article, user: article.user}.to_json).call + reaction_points
|
||||
end
|
||||
|
||||
def self.comment_quality_score(comment)
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ class Reaction < ApplicationRecord
|
|||
|
||||
def assign_points
|
||||
base_points = if category == "vomit"
|
||||
-25.0
|
||||
-50.0
|
||||
elsif category == "thumbsdown"
|
||||
-5.0
|
||||
-10.0
|
||||
else
|
||||
1.0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,9 +38,16 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @user.email_public && @user.employer_name.present? && @user.location.present? && @user.education.present? %>
|
||||
|
||||
<% if @user.email_public &&
|
||||
@user.employer_name.present? &&
|
||||
@user.location.present? &&
|
||||
@user.education.present? &&
|
||||
@user.education.size > 25 &&
|
||||
@user.summary.to_s.size < 145
|
||||
%>
|
||||
<style>
|
||||
.user-profile-header {min-height: 410px;}
|
||||
.user-profile-header {min-height: 398px;}
|
||||
</style>
|
||||
<% end %>
|
||||
<% if @user.email_public %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue