Module: Decidim::ActsAsTree

Extended by:
ActiveSupport::Concern
Included in:
Comments::Comment
Defined in:
decidim-core/lib/decidim/acts_as_tree.rb

Instance Method Summary collapse

Instance Method Details

#descendantsObject



39
40
41
# File 'decidim-core/lib/decidim/acts_as_tree.rb', line 39

def descendants
  @descendants ||= self_and_descendants.where.not(id:)
end

#self_and_descendantsObject



43
44
45
# File 'decidim-core/lib/decidim/acts_as_tree.rb', line 43

def self_and_descendants
  @self_and_descendants ||= self.class.tree_for(self)
end