app/presenters/tree_builder_chargeback_reports.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)
    items = MiqReportResult.auto_generated.select("miq_report_id, name").group("miq_report_id, name").where(
      :db     => "Chargeback",
      :userid => User.current_user.userid)
    if count_only
      items.length
    else
      objects = []
      items.sort_by { |item| item.name.downcase }.each_with_index do |item, idx|
        objects.push(
          :id    => "#{to_cid(item.miq_report_id)}-#{idx}",
          :text  => item.name,
          :image => "report",
          :tip   => item.name
        )
      end
      objects
    end
  end
def x_get_tree_roots ( count_only , _options ) items = MiqReportResult . auto_generated . select ( "miq_report_id, name" ) . group ( "miq_report_id, name" ) . where ( :db => "Chargeback" , :userid => User . current_user . userid ) if count_only items . length else objects = [ ] items . sort_by { | item | item . name . downcase } . each_with_index do | item , idx | objects . push ( :id => "#{to_cid(item.miq_report_id)}-#{idx}" , :text => item . name , :image => "report" , :tip => item . name ) end objects end end
Get root nodes count/array for explorer tree
Get root nodes count / array for explorer tree
count_only
<not_specific>
_options
<not_specific>