Add collection cache in articles/full_comment_area (#15278)

* Add collection cache in articles/full_comment_area

* Add missing file
This commit is contained in:
Mac Siri 2021-11-04 10:38:29 -04:00 committed by GitHub
parent 307f088d05
commit 2f42bc46d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -0,0 +1,2 @@
<% comment, sub_comments = comment_node %>
<%= nested_comments(tree: { comment => sub_comments }, commentable: @article, is_view_root: true) %>

View file

@ -28,11 +28,7 @@
<div class="comments" id="comment-trees-container">
<% if @article.comments_count > 0 %>
<% Comment.tree_for(@article, @comments_to_show_count).each do |comment, sub_comments| %>
<% cache ["comment_root_cached_tree", comment] do %>
<%= tree_for(comment, sub_comments, @article) %>
<% end %>
<% end %>
<%= render partial: "articles/comment_tree", collection: Comment.tree_for(@article, @comments_to_show_count), as: :comment_node, cached: proc { |comment, _sub_comments| comment } %>
<% end %>
</div>
</div>