mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
codeclimate fix (api_users)
This commit is contained in:
parent
9f2f72b146
commit
0c2dc9f957
2 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t(:result_count, count: @count) %>
|
||||
<%= t(:result_count, count: @q.result.count) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue