Remove current article id from potential queried articles (#247)
This commit is contained in:
parent
af37587de5
commit
3903a3a5e4
1 changed files with 1 additions and 0 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue