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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-24 15:09:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-24 15:09:42 +0300
commit729e3765d5feb762df1ccfbc228a8dd4662aa3f9 (patch)
treef326420fc64999c6bcc28816ed54f0972fb46459 /app/finders
parent6f7881ee9dcec34141a8f34fc814b56b366d2b48 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/events_finder.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/finders/events_finder.rb b/app/finders/events_finder.rb
index 7755cbdf9e5..9c56451fd44 100644
--- a/app/finders/events_finder.rb
+++ b/app/finders/events_finder.rb
@@ -52,10 +52,17 @@ class EventsFinder
if current_user && scope == 'all'
EventCollection.new(current_user.authorized_projects).all_project_events
else
- source.events
+ # EventCollection is responsible for applying the feature flag
+ apply_feature_flags(source.events)
end
end
+ def apply_feature_flags(events)
+ return events if ::Feature.enabled?(:wiki_events)
+
+ events.not_wiki_page
+ end
+
# rubocop: disable CodeReuse/ActiveRecord
def by_current_user_access(events)
events.merge(Project.public_or_visible_to_user(current_user))