Class: Use

Inherits:
MLS::Model show all
Includes:
MLS::Slugger
Defined in:
lib/mls/models/use.rb

Instance Method Summary collapse

Instance Method Details

#descendants(uses = nil) ⇒ Object

has_and_belongs_to_many :properties



11
12
13
14
15
16
17
18
19
# File 'lib/mls/models/use.rb', line 11

def descendants(uses = nil)
  # Recursive self + children of children
  uses ||= [self]
  self.children.each do |child|
    uses << child
    uses = child.descendants(uses)
  end
  uses
end