mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 12:09:34 +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 edit; end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
method = params[:records].present? ? params[:records] : 'api_users'
|
method = allowed_method(params[:records]) || 'api_users'
|
||||||
@result = @registrar.send(method)
|
@result = @registrar.send(method.to_sym)
|
||||||
render_by_format('admin/registrars/show', "#{@registrar.name.parameterize}_#{method}")
|
partial_name = "#{@registrar.name.parameterize}_#{method}"
|
||||||
|
render_by_format('admin/registrars/show', partial_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@ -176,5 +177,10 @@ module Admin
|
||||||
def iban_max_length
|
def iban_max_length
|
||||||
Iban.max_length
|
Iban.max_length
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allowed_method(records_param)
|
||||||
|
allowed_methods = %w[api_users white_ips]
|
||||||
|
records_param if allowed_methods.include?(records_param)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,7 +100,7 @@ class ApiUser < User
|
||||||
active,
|
active,
|
||||||
accredited?,
|
accredited?,
|
||||||
accreditation_expire_date,
|
accreditation_expire_date,
|
||||||
created_at, updated_at,
|
created_at, updated_at
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue