Github user mitchell852 commented on a diff in the pull request: https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124592678 --- Diff: traffic_ops/app/lib/API/Tenant.pm --- @@ -31,34 +32,28 @@ sub getTenantName { return defined($tenant_id) ? $self->db->resultset('Tenant')->search( { id => $tenant_id } )->get_column('name')->single() : "n/a"; } -sub isRootTenant { - my $self = shift; - my $tenant_id = shift; - return !defined($self->db->resultset('Tenant')->search( { id => $tenant_id } )->get_column('parent_id')->single()); -} - sub index { - my $self = shift; - my @data = (); - my %idnames; + my $self = shift; my $orderby = $self->param('orderby') || "name"; - my $rs_data = $self->db->resultset("Tenant")->search(); - while ( my $row = $rs_data->next ) { - $idnames{ $row->id } = $row->name; - } + my $tenant_utils = UI::TenantUtils->new($self); --- End diff -- and then you can just call it Utils::Tenant
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---