diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 15:09:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 15:09:42 +0300 |
commit | 729e3765d5feb762df1ccfbc228a8dd4662aa3f9 (patch) | |
tree | f326420fc64999c6bcc28816ed54f0972fb46459 /app/models/event.rb | |
parent | 6f7881ee9dcec34141a8f34fc814b56b366d2b48 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/event.rb')
-rw-r--r-- | app/models/event.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index c4ca5389fdf..447ab753421 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -36,6 +36,8 @@ class Event < ApplicationRecord expired: EXPIRED ).freeze + WIKI_ACTIONS = [CREATED, UPDATED, DESTROYED].freeze + TARGET_TYPES = HashWithIndifferentAccess.new( issue: Issue, milestone: Milestone, @@ -81,7 +83,10 @@ class Event < ApplicationRecord scope :recent, -> { reorder(id: :desc) } scope :code_push, -> { where(action: PUSHED) } scope :merged, -> { where(action: MERGED) } - scope :for_wiki_page, -> { where(target_type: WikiPage::Meta.name) } + scope :for_wiki_page, -> { where(target_type: 'WikiPage::Meta') } + + # Needed to implement feature flag: can be removed when feature flag is removed + scope :not_wiki_page, -> { where('target_type IS NULL or target_type <> ?', 'WikiPage::Meta') } scope :with_associations, -> do # We're using preload for "push_event_payload" as otherwise the association @@ -229,7 +234,7 @@ class Event < ApplicationRecord end def wiki_page? - target_type == WikiPage::Meta.name + target_type == 'WikiPage::Meta' end def milestone |