lib/active_record/acts/dag.rb
# return a list of all descendants of this graph node
return a list of all descendants of this graph node
return a list of all descendants of this graph node
def descendants                
          stack = [ self.send(acts_as_dag_configuration[:in]) ].flatten
          nodes = {}
          while stack.length > 0
            n = stack.pop
            if n and ! nodes[n.id]                   
              nodes[n.id] = n
                (stack << [n.send(acts_as_dag_configuration[:in])]).flatten!
            end
          end
          nodes.values
        end
def descendants stack = [ self . send ( acts_as_dag_configuration [ :in ] ) ] . flatten nodes = { } while stack . length > 0 n = stack . pop if n and ! nodes [ n . id ] nodes [ n . id ] = n ( stack << [ n . send ( acts_as_dag_configuration [ :in ] ) ] ) . flatten! end end nodes . values end
return a list of all descendants of this graph node
return a list of all descendants of this graph node