Module: Decidim::ActsAsTree

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

Overview

Instance Method Summary collapse

Instance Method Details

#descendantsObject



52
53
54
# File 'lib/decidim/acts_as_tree.rb', line 52

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

#self_and_descendantsObject



56
57
58
# File 'lib/decidim/acts_as_tree.rb', line 56

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