Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/events_finder.rb')
-rw-r--r--app/finders/events_finder.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/finders/events_finder.rb b/app/finders/events_finder.rb
index 4c619f3d7ea..4ed447a90ce 100644
--- a/app/finders/events_finder.rb
+++ b/app/finders/events_finder.rb
@@ -44,7 +44,6 @@ class EventsFinder
events = by_created_at_after(events)
events = sort(events)
- events = events.with_associations if params[:with_associations]
paginated_filtered_by_user_visibility(events)
end
@@ -113,10 +112,12 @@ class EventsFinder
end
def paginated_filtered_by_user_visibility(events)
+ events_count = events.count
+ events = events.with_associations if params[:with_associations]
limited_events = events.page(page).per(per_page)
visible_events = limited_events.select { |event| event.visible_to_user?(current_user) }
- Kaminari.paginate_array(visible_events, total_count: events.count)
+ Kaminari.paginate_array(visible_events, total_count: events_count)
end
def per_page