codeclimate fix (api_users)

This commit is contained in:
dinsmol 2021-07-30 14:30:02 +03:00
parent 9f2f72b146
commit 0c2dc9f957
2 changed files with 6 additions and 3 deletions

View file

@ -5,8 +5,7 @@ module Admin
def index
@q = ApiUser.includes(:registrar).search(params[:q])
@api_users = @q.result.page(params[:page])
@count = @q.result.count
@api_users = @api_users.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
api_users_paginate if params[:results_per_page].to_i.positive?
end
def new
@ -58,5 +57,9 @@ module Admin
def registrar
Registrar.find(params[:registrar_id])
end
def api_users_paginate
@api_users = @api_users.per(params[:results_per_page])
end
end
end