app/presenters/tree_builder_chargeback_assignments.rb
# Get root nodes count/array for explorer tree
Get root nodes count/array for explorer tree
Get root nodes count / array for explorer tree
def x_get_tree_roots(count_only, options)
    case options[:type]
    when :cb_assignments, :cb_rates
      rate_types = ChargebackRate::VALID_CB_RATE_TYPES
      if count_only
        rate_types.length
      else
        objects = []
        rate_types.sort.each do |rtype|
          img = rtype.downcase == "compute" ? "hardware-processor" : "hardware-disk"
          objects.push(
            :id    => rtype,
            :text  => rtype,
            :image => img,
            :tip   => rtype
          )
        end
        objects
      end
    end
  end
def x_get_tree_roots ( count_only , options ) case options [ :type ] when :cb_assignments , :cb_rates rate_types = ChargebackRate :: VALID_CB_RATE_TYPES if count_only rate_types . length else objects = [ ] rate_types . sort . each do | rtype | img = rtype . downcase == "compute" ? "hardware-processor" : "hardware-disk" objects . push ( :id => rtype , :text => rtype , :image => img , :tip => rtype ) end objects end end end
Get root nodes count/array for explorer tree
Get root nodes count / array for explorer tree
# TODO: Common code in CharbackRate & ChargebackAssignments, need to move into module
count_only
<not_specific>
options
<not_specific>