add pagination to API

This commit is contained in:
Nihad Abbasov 2012-09-03 04:46:29 -07:00
parent 6817a6a295
commit 76e4d94d43
6 changed files with 16 additions and 5 deletions

View file

@ -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