Class: Use

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

Instance Method Summary collapse

Instance Method Details

#descendants(uses = nil) ⇒ Object

has_and_belongs_to_many :properties



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

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