From 1a04a51b5249d78e4a3cfd47572a5e3dba3c4ad3 Mon Sep 17 00:00:00 2001 From: Airat Shigapov Date: Fri, 21 Oct 2016 14:38:08 +0300 Subject: Fix events order in user contributions API --- lib/api/users.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/api/users.rb') diff --git a/lib/api/users.rb b/lib/api/users.rb index e868f628404..20801b7e294 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -333,10 +333,11 @@ module API user = User.find_by(id: declared(params).id) not_found!('User') unless user - events = user.recent_events. + events = user.events. merge(ProjectsFinder.new.execute(current_user)). references(:project). with_associations. + recent. page(params[:page]) present paginate(events), with: Entities::Event -- cgit v1.2.1 From 3685e867c8bd34b8e56a7fc69c99c9563ce49a68 Mon Sep 17 00:00:00 2001 From: Airat Shigapov Date: Fri, 21 Oct 2016 14:38:32 +0300 Subject: Get rid of extra .page call --- lib/api/users.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/api/users.rb') diff --git a/lib/api/users.rb b/lib/api/users.rb index 20801b7e294..c28e07a76b7 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -337,8 +337,7 @@ module API merge(ProjectsFinder.new.execute(current_user)). references(:project). with_associations. - recent. - page(params[:page]) + recent present paginate(events), with: Entities::Event end -- cgit v1.2.1