diff --git a/app/labor/sticky_article_collection.rb b/app/labor/sticky_article_collection.rb index 09e526e48..8f278f8d5 100644 --- a/app/labor/sticky_article_collection.rb +++ b/app/labor/sticky_article_collection.rb @@ -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) diff --git a/app/views/articles/_sticky_nav.html.erb b/app/views/articles/_sticky_nav.html.erb index f811ef258..bb5f56d81 100644 --- a/app/views/articles/_sticky_nav.html.erb +++ b/app/views/articles/_sticky_nav.html.erb @@ -72,7 +72,7 @@ <% @sticky_articles.each_with_index do |article, index| %> - <%= article.user.name %> profile image + <%= article.cached_user.name %> profile image
<%= article.title %>