Merge branch 'develop' into standalone_develop
This commit is contained in:
commit
22929e54d3
|
@ -680,6 +680,14 @@ class ApplicationController < ActionController::Base
|
|||
relation.page(page).per(limit)
|
||||
end
|
||||
|
||||
def kaminari_unlimit_paginate(ralation)
|
||||
limit = params[:limit] || params[:per_page]
|
||||
limit = (limit.to_i.zero? || limit.to_i > 9999) ? 9999 : limit.to_i
|
||||
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
|
||||
|
||||
relation.page(page).per(limit)
|
||||
end
|
||||
|
||||
def kaminari_array_paginate(relation)
|
||||
limit = params[:limit] || params[:per_page]
|
||||
limit = (limit.to_i.zero? || limit.to_i > 20) ? 20 : limit.to_i
|
||||
|
|
|
@ -406,7 +406,7 @@ class UsersController < ApplicationController
|
|||
is_current_admin_user = User.current.logged? && (current_user&.admin? || current_user.id == @user.id)
|
||||
scope = Projects::ListMyQuery.call(params, @user,is_current_admin_user)
|
||||
@total_count = scope.size
|
||||
@projects = paginate(scope)
|
||||
@projects = kaminari_unlimit_paginate(scope)
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue