Add score minimum to a couple missing places (#1133)

This commit is contained in:
Ben Halpern 2018-11-16 18:16:33 -05:00 committed by GitHub
parent f744f43493
commit cbf8d76d94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,7 @@ class StoriesController < ApplicationController
@featured_story = @stories.where.not(main_image: nil).first&.decorate || Article.new
elsif params[:timeframe] == "latest"
@stories = @stories.order("published_at DESC").
where("featured_number > ?", 1449999999)
where("featured_number > ? AND score > ?", 1449999999, -40)
@featured_story = Article.new
else
@default_home_feed = true
@ -258,7 +258,7 @@ class StoriesController < ApplicationController
@stories.where("published_at > ?", Timeframer.new(params[:timeframe]).datetime).
order("positive_reactions_count DESC")
elsif params[:timeframe] == "latest"
@stories.order("published_at DESC")
@stories.where("score > ?", -40).order("published_at DESC")
else
@stories.order("hotness_score DESC")
end