ManageIQ/manageiq-ui-classic

View on GitHub
app/presenters/tree_builder_catalogs_class.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
87%
class TreeBuilderCatalogsClass < TreeBuilder
  include CustomButtonsMixin
  has_kids_for CustomButtonSet, [:x_get_tree_aset_kids]

  private

  def node_by_tree_id(id)
    # Creating empty record to show items under unassigned catalogs
    super(id) || ServiceTemplateCatalog.new
  end

  def x_get_tree_roots
    count_only_or_objects_filtered(false, ServiceTemplateCatalog.all, "name")
  end
end