app/cells/decidim/comments/comment_cell.rb in decidim-comments-0.26.10 vs app/cells/decidim/comments/comment_cell.rb in decidim-comments-0.27.0.rc1

- old
+ new

@@ -184,14 +184,14 @@ def commentable? has_replies? && !model.deleted? && !model.hidden? end def has_replies? - model.comment_threads.includes(:moderation).collect { |c| !c.deleted? && !c.hidden? }.any? + model.comment_threads.not_hidden.not_deleted.exists? end def has_replies_in_children? - has_replies? || model.comment_threads.includes(:moderation).collect { |t| t.comment_threads.includes(:moderation).collect { |c| !c.deleted? && !c.hidden? }.any? }.any? + model.descendants.where(decidim_commentable_type: "Decidim::Comments::Comment").not_hidden.not_deleted.exists? end # action_authorization_button expects current_component to be available def current_component root_commentable.try(:component)