mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 14:36:22 +02:00
Fixed codeclimate issues
This commit is contained in:
parent
dc41cfb103
commit
f721bc50a3
2 changed files with 10 additions and 4 deletions
|
@ -40,9 +40,10 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def show
|
||||
method = params[:records].present? ? params[:records] : 'api_users'
|
||||
@result = @registrar.send(method)
|
||||
render_by_format('admin/registrars/show', "#{@registrar.name.parameterize}_#{method}")
|
||||
method = allowed_method(params[:records]) || 'api_users'
|
||||
@result = @registrar.send(method.to_sym)
|
||||
partial_name = "#{@registrar.name.parameterize}_#{method}"
|
||||
render_by_format('admin/registrars/show', partial_name)
|
||||
end
|
||||
|
||||
def update
|
||||
|
@ -176,5 +177,10 @@ module Admin
|
|||
def iban_max_length
|
||||
Iban.max_length
|
||||
end
|
||||
|
||||
def allowed_method(records_param)
|
||||
allowed_methods = %w[api_users white_ips]
|
||||
records_param if allowed_methods.include?(records_param)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue