[deploy] Remove unneeded eager load (#10168)

This commit is contained in:
Ben Halpern 2020-09-02 16:43:41 -04:00 committed by GitHub
parent 83d44401f5
commit 7f928555a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -22,7 +22,6 @@ class StickyArticleCollection
def tag_articles
@tag_articles ||= Article.published.tagged_with(article_tags, any: true)
.includes(:user)
.where("public_reactions_count > ? OR comments_count > ?", reaction_count_num, comment_count_num)
.where.not(id: article.id).where.not(user_id: article.user_id)
.where("featured_number > ?", 5.days.ago.to_i)
@ -34,7 +33,6 @@ class StickyArticleCollection
return [] if tag_articles.size > 6
Article.published.tagged_with(%w[career productivity discuss explainlikeimfive], any: true)
.includes(:user)
.where("comments_count > ?", comment_count_num)
.where.not(id: article.id).where.not(user_id: article.user_id)
.where("featured_number > ?", 5.days.ago.to_i)

View file

@ -72,7 +72,7 @@
<% @sticky_articles.each_with_index do |article, index| %>
<a class="crayons-link crayons-link--contentful flex" href="<%= article.path %>">
<span class="crayons-avatar mr-2 shrink-0">
<img src="<%= ProfileImage.new(article.user).get(width: 90) %>" class="crayons-avatar__image" loading="lazy" alt="<%= article.user.name %> profile image">
<img src="<%= ProfileImage.new(article.cached_user).get(width: 90) %>" class="crayons-avatar__image" loading="lazy" alt="<%= article.cached_user.name %> profile image">
</span>
<div>
<%= article.title %>