Skip to content

Commit a5f5b53

Browse files
authored
Merge pull request #3440 from DMPRoadmap/aaron/bullet-fixes
Address Some Bullet Warnings / Optimise Mean Request Times
2 parents 994bb60 + d6687c8 commit a5f5b53

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

app/controllers/org_admin/plans_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ def index
1717

1818
@super_admin = current_user.can_super_admin?
1919
@clicked_through = params[:click_through].present?
20-
@plans = @super_admin ? Plan.all.page(1) : current_user.org.org_admin_plans.page(1)
20+
@plans = if @super_admin
21+
Plan.all.page(1).includes(:template, roles: { user: :org })
22+
else
23+
current_user.org.org_admin_plans.page(1)
24+
end
2125
end
2226
# rubocop:enable Metrics/AbcSize
2327

app/controllers/public_pages_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def template_export
8585
# GET /plans_index
8686
# ------------------------------------------------------------------------------------
8787
def plan_index
88-
@plans = Plan.publicly_visible.includes(:template)
88+
@plans = Plan.publicly_visible.includes(:template, roles: { user: :org })
8989
render 'plan_index', locals: {
9090
query_params: {
9191
page: paginable_params.fetch(:page, 1),

app/views/org_admin/plans/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</div>
3535
</div>
3636
<% end %>
37-
<% if @plans.length > 0 %>
37+
<% if @plans.any? %>
3838
<% unless @super_admin %>
3939
<%= link_to sanitize(_('Download plans <em class="sr-only">(new window)</em><span class="new-window-popup-info">%{open_in_new_window_text}</span>') %
4040
{ open_in_new_window_text: _('Opens in new window') },

app/views/super_admin/api_clients/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%
22
url = @api_client.new_record? ? super_admin_api_clients_path : super_admin_api_client_path(@api_client)
33
method = @api_client.new_record? ? :post : :put
4-
orgs = Org.where(is_other: false)
4+
orgs = Org.where(is_other: false).includes(identifiers: :identifier_scheme)
55
%>
66

77
<%= form_for @api_client, url: url, method: method,

0 commit comments

Comments
 (0)