Remove unnecessary eager loading (#6063)

Bullet doesn't seem to like this, and it makes sense because we don't
want to load ALL reactions, just some of them.

Co-authored-by: nspinazz89 <nspinazz89@gmail.com>

Co-authored-by: Nick S <nspinazz89@gmail.com>
This commit is contained in:
Jacob Herrington 2020-02-17 08:39:30 -06:00 committed by GitHub
parent cc53b55a4a
commit 40bc7ecedd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,6 @@ class Internal::CommentsController < Internal::ApplicationController
Comment.
includes(:user).
includes(:commentable).
includes(:reactions).
order("positive_reactions_count DESC").
where("created_at > ?", params[:state].split("-").last.to_i.days.ago).
page(params[:page] || 1).per(50)
@ -14,7 +13,6 @@ class Internal::CommentsController < Internal::ApplicationController
Comment.
includes(:user).
includes(:commentable).
includes(:reactions).
order("created_at DESC").
page(params[:page] || 1).per(50)
end