From: Dmitriy Zaporozhets Date: Tue, 16 Apr 2013 06:26:01 +0000 (+0300) Subject: Paginate users in users api X-Git-Tag: v5.1.0~39 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=880cb8aa487a78c22bedb26b3cfd0e1d8590a932;p=wvm%2Fgitlab.git Paginate users in users api --- diff --git a/doc/api/users.md b/doc/api/users.md index c05bcb3e5..ee5e98a01 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -1,6 +1,7 @@ ## List users Get a list of users. +This function takes pagination parameters `page` and `per_page` to restrict the list of users. ``` GET /users diff --git a/lib/api/users.rb b/lib/api/users.rb index 125a86240..4198387d4 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -12,6 +12,7 @@ module Gitlab @users = User.scoped @users = @users.active if params[:active].present? @users = @users.search(params[:search]) if params[:search].present? + @users = paginate @users present @users, with: Entities::User end