Fixed codeclimate issues

This commit is contained in:
Sergei Tsoganov 2023-05-15 14:30:18 +03:00
parent dc41cfb103
commit f721bc50a3
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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