Przeglądaj źródła

Fix pagination mixup

Maarten van den Berg 7 lat temu
rodzic
commit
5a495cc9d6
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      app/controllers/dashboard_controller.rb

+ 2 - 1
app/controllers/dashboard_controller.rb

@@ -7,10 +7,11 @@ class DashboardController < ApplicationController
7 7
       .joins(:activity)
8 8
       .where('activities.end >= ? OR (activities.end IS NULL AND activities.start >= ?)', DateTime.now, DateTime.now)
9 9
       .order('activities.start ASC')
10
-      .paginate(page: params[:upage], per_page: 10)
11 10
     @user_organized = @upcoming
12 11
       .where(is_organizer: true)
13 12
       .limit(3)
13
+    @upcoming = @upcoming
14
+      .paginate(page: params[:upage], per_page: 10)
14 15
     @need_response = @upcoming
15 16
       .where(attending: nil)
16 17
       .paginate(page: params[:nrpage], per_page: 5)