diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 21:08:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 21:08:04 +0300 |
commit | bbe243060399191abcba33c7ebd611f6ec34c6cd (patch) | |
tree | 769ba47355cb903bc9139232d75710232ccb545a /app/models/event_collection.rb | |
parent | ccf37fd3eca15cd5f55c1eba3b28d2798808d357 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/event_collection.rb')
-rw-r--r-- | app/models/event_collection.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/event_collection.rb b/app/models/event_collection.rb index 4778f74568e..4768506b8fa 100644 --- a/app/models/event_collection.rb +++ b/app/models/event_collection.rb @@ -30,17 +30,24 @@ class EventCollection relation = if groups project_and_group_events else - relation_with_join_lateral('project_id', projects) + project_events end relation = paginate_events(relation) relation.with_associations.to_a end + def all_project_events + Event.from_union([project_events]).recent + end + private + def project_events + relation_with_join_lateral('project_id', projects) + end + def project_and_group_events - project_events = relation_with_join_lateral('project_id', projects) group_events = relation_with_join_lateral('group_id', groups) Event.from_union([project_events, group_events]).recent |