diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 15:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 15:09:15 +0300 |
commit | 20d564f1064622ef0623434372ac3ceb03173331 (patch) | |
tree | 000d95440566cd189ea774168c9756bcc8fc5fae /lib/gitlab/search | |
parent | 26384c9a61da9922b8fa4b8351d4e42d51661b37 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/search')
-rw-r--r-- | lib/gitlab/search/found_blob.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/search/found_wiki_page.rb | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/lib/gitlab/search/found_blob.rb b/lib/gitlab/search/found_blob.rb index 360239a84e4..f472c70446c 100644 --- a/lib/gitlab/search/found_blob.rb +++ b/lib/gitlab/search/found_blob.rb @@ -7,6 +7,7 @@ module Gitlab include Presentable include BlobLanguageFromGitAttributes include Gitlab::Utils::StrongMemoize + include BlobActiveModel attr_reader :project, :content_match, :blob_path diff --git a/lib/gitlab/search/found_wiki_page.rb b/lib/gitlab/search/found_wiki_page.rb new file mode 100644 index 00000000000..99ca6a79fe2 --- /dev/null +++ b/lib/gitlab/search/found_wiki_page.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# - rendering by using data purely from Elasticsearch and does not trigger Gitaly calls. +# - allows policy check +module Gitlab + module Search + class FoundWikiPage < SimpleDelegator + attr_reader :wiki + + def self.declarative_policy_class + 'WikiPagePolicy' + end + + # @param found_blob [Gitlab::Search::FoundBlob] + def initialize(found_blob) + super + @wiki = found_blob.project.wiki + end + + def to_ability_name + 'wiki_page' + end + end + end +end |