diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2015-03-29 03:36:53 +0300 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2015-03-29 03:36:53 +0300 |
commit | bba2b10eb5430195b3f5f874c0379fe77213246a (patch) | |
tree | fdeac0d35d3ae8a85b6b3534dc8dca28a4420b0d /lib/api | |
parent | 7277280d5f276fe97ff97276ce20400bcb5db07c (diff) |
properly paginate project events in API
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/projects.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 83f65eec6cc..620922092de 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -95,10 +95,7 @@ module API # Example Request: # GET /projects/:id/events get ":id/events" do - limit = (params[:per_page] || 20).to_i - offset = (params[:page] || 0).to_i * limit - events = user_project.events.recent.limit(limit).offset(offset) - + events = paginate user_project.events.recent present events, with: Entities::Event end |