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:
parent
307f088d05
commit
2f42bc46d4
2 changed files with 3 additions and 5 deletions
2
app/views/articles/_comment_tree.html.erb
Normal file
2
app/views/articles/_comment_tree.html.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<% comment, sub_comments = comment_node %>
|
||||
<%= nested_comments(tree: { comment => sub_comments }, commentable: @article, is_view_root: true) %>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue