Module: Decidim::ActsAsTree

Extended by:
ActiveSupport::Concern
Defined in:
lib/decidim/acts_as_tree.rb

Instance Method Summary collapse

Instance Method Details

#descendantsObject



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

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

#self_and_descendantsObject



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

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