From 6cf8a79c716eb71d15db92009a9357399a03a083 Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Sat, 28 Apr 2018 17:48:20 -0400 Subject: [PATCH] Remove current article author from sticky sidebar (#256) --- app/controllers/stories_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index e00696b0a..34086274d 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -286,7 +286,7 @@ class StoriesController < ApplicationController includes(:user). where("positive_reactions_count > ? OR comments_count > ?", reaction_count_num, comment_count_num). where(published: true). - where.not(id: @article.id). + where.not(id: @article.id, user_id: @article.user_id). where("featured_number > ?", 5.days.ago.to_i). order("RANDOM()"). limit(8) @@ -295,7 +295,7 @@ class StoriesController < ApplicationController includes(:user). where("comments_count > ?", comment_count_num). where(published: true). - where.not(id: @article.id). + where.not(id: @article.id, user_id: @article.user_id). where("featured_number > ?", 5.days.ago.to_i). order("RANDOM()"). limit(10 - tag_articles.size)