Remove current article author from sticky sidebar (#256)

This commit is contained in:
Ben Halpern 2018-04-28 17:48:20 -04:00 committed by GitHub
parent 2001963863
commit 6cf8a79c71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)