Method: ActiveRecord::Acts::Tree::InstanceMethods#self_and_descendants

Defined in:
lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb

#self_and_descendants(depth = nil) ⇒ Object

Returns list of descendants and a reference to the current node.

root.self_and_descendants # => [root, child1, subchild1, subchild2]


84
85
86
# File 'lib/plugins/acts_as_tree/lib/active_record/acts/tree.rb', line 84

def self_and_descendants(depth=nil)
  [self] + descendants(depth)
end