0
그룹 => has_many =>이 보고서
보고서 => has_many =>
댓글 4 개 가지 모델- 그룹
- 보고서
- 댓글
- 사용자가
코멘트 => Belongs_to =>
내가
<%= @group.name %> <%= @group.reports.includes(:comments).each do |report| %> <%= report.name %> <% report.comments.each do |comment| %> <%= comment.name %> <%= comment.user.name %> <% end %> <% end %>
이 경우 N + 1 쿼리 문제를 해결하는 가장 좋은 방법은 무엇입니까
같은 일을 할 그룹을 보여주고 싶은 사용자?