core/rails/app/models/node.rb
# look at Node state by scanning all node roles.
look at Node state by scanning all node roles.
look at Node state by scanning all node roles .
def state
    Node.transaction do
      node_roles.each do |nr|
        return nr.state if [NodeRole::TRANSITION, NodeRole::ERROR, NodeRole::PROPOSED].include? nr.state
      end
      node_roles.each do |nr|
        return NodeRole::TODO if [NodeRole::BLOCKED, NodeRole::TODO].include? nr.state
      end
    end
    return NodeRole::ACTIVE
  end
def state Node . transaction do node_roles . each do | nr | return nr . state if [ NodeRole :: TRANSITION , NodeRole :: ERROR , NodeRole :: PROPOSED ] . include? nr . state end node_roles . each do | nr | return NodeRole :: TODO if [ NodeRole :: BLOCKED , NodeRole :: TODO ] . include? nr . state end end return NodeRole :: ACTIVE end
look at Node state by scanning all node roles.
look at Node state by scanning all node roles .
# first look for single items that change the whole node # then scan for secondary items (ordering could hide the earlier items) # fall through (all NRs must be active)