From 3903a3a5e43758588243ff1b492f3889cca0ebda Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Wed, 25 Apr 2018 18:46:36 -0400 Subject: [PATCH] Remove current article id from potential queried articles (#247) --- app/views/articles/_sticky_nav.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/articles/_sticky_nav.html.erb b/app/views/articles/_sticky_nav.html.erb index 7089c282b..908635b16 100644 --- a/app/views/articles/_sticky_nav.html.erb +++ b/app/views/articles/_sticky_nav.html.erb @@ -42,6 +42,7 @@ includes(:user). where("positive_reactions_count > ? OR comments_count > ?", (Rails.env.production? ? 20 : -1 ), (Rails.env.production? ? 8 : -1 )). where(published: true). + where.not(id: @article.id). where("featured_number > ?", 5.days.ago.to_i). order("RANDOM()"). limit(8).