Skip to content

Commit

Permalink
Make Rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronskiba committed Jun 11, 2024
1 parent a764618 commit 169a747
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 5 additions & 1 deletion app/controllers/org_admin/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ def index

@super_admin = current_user.can_super_admin?
@clicked_through = params[:click_through].present?
@plans = @super_admin ? Plan.all.page(1).includes(:template, roles: { user: :org }) : current_user.org.org_admin_plans.page(1).includes(roles: { user: :org })
@plans = if @super_admin
Plan.all.page(1).includes(:template, roles: { user: :org })
else
current_user.org.org_admin_plans.page(1).includes(roles: { user: :org })
end
end
# rubocop:enable Metrics/AbcSize

Expand Down
12 changes: 4 additions & 8 deletions app/controllers/org_admin/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module OrgAdmin
# Controller that handles templates
# rubocop:disable Metrics/ClassLength
class TemplatesController < ApplicationController
include Paginable
include Versionable
Expand Down Expand Up @@ -33,7 +32,7 @@ def index
# A version of index that displays only templates that belong to the user's org
# GET /org_admin/templates/organisational
# -----------------------------------------------------
# rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
# rubocop:disable Metrics/AbcSize
def organisational
authorize Template
templates = Template.latest_version_per_org(current_user.org.id).includes(:org)
Expand All @@ -54,13 +53,12 @@ def organisational
@unpublished_count = @all_count - @published_count
render :index
end
# rubocop:enable Metrics/AbcSize, Metrics/PerceivedComplexity
# rubocop:enable Metrics/AbcSize

# A version of index that displays only templates that are customizable
# GET /org_admin/templates/customisable
# -----------------------------------------------------
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
# rubocop:disable Metrics/AbcSize
def customisable
authorize Template
funder_templates = Template.latest_customizable.includes(:org)
Expand All @@ -87,9 +85,8 @@ def customisable

render :index
end
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity

# rubocop:enable Metrics/AbcSize
# GET /org_admin/templates/[:id]
def show
template = Template.find(params[:id])
Expand Down Expand Up @@ -405,5 +402,4 @@ def get_referrer(template, referrer)
end
end
end
# rubocop:enable Metrics/ClassLength
end

0 comments on commit 169a747

Please sign in to comment.