diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-09-03 05:04:23 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-09-03 05:04:23 -0700 |
commit | 0c5e556922b4c7ff71c6af6255a0f6783e25ca0c (patch) | |
tree | 25d3df538ef33fcd3298672bfca8ef751e9fda22 /lib/api/helpers.rb | |
parent | cc03600b22342a541ab1b4617eaf4d38d6d2d1da (diff) | |
parent | 76e4d94d432b19d7dd58503c5eac46811630c04a (diff) | |
download | gitlab-ce-0c5e556922b4c7ff71c6af6255a0f6783e25ca0c.tar.gz |
Merge pull request #1360 from NARKOZ/api
API pagination
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index c1ea05667ae..ce7b7b497fc 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -14,6 +14,10 @@ module Gitlab @project end + def paginate(object) + object.page(params[:page]).per(params[:per_page].to_i) + end + def authenticate! error!({'message' => '401 Unauthorized'}, 401) unless current_user end |