Skip to content

Commit

Permalink
Remove unused providers helper
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Oct 16, 2024
1 parent 02a6af9 commit 7d89e79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class ProvidersController < ::ApplicationController
before_action :find_provider, only: %i[edit update destroy]
before_action :set_edit_state, only: %i[create edit update]

def index; end
def index
@providers = ::OpenIDConnect::Provider.all
end

def new
oidc_provider = case params[:oidc_provider]
Expand Down Expand Up @@ -81,16 +83,10 @@ def check_ee
end

def find_provider
@provider = providers.where(id: params[:id]).first
if @provider.nil?
render_404
end
end

def providers
@providers ||= ::OpenIDConnect::Provider.where(available: true)
@provider = OpenIDConnect::Provider.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
helper_method :providers

def default_breadcrumb; end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
end
%>

<%= render ::OpenIDConnect::Providers::TableComponent.new(rows: providers) %>
<%= render ::OpenIDConnect::Providers::TableComponent.new(rows: @providers) %>

0 comments on commit 7d89e79

Please sign in to comment.