diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-04 01:32:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-04 01:32:18 +0300 |
commit | b7a47b151165e1313c9c526e1af8032601f7afd7 (patch) | |
tree | 8966651a39b27595341c180ef14d65f147c2b527 /lib/gitlab | |
parent | fa206403d6b6a501488b70173ba873189776edc6 (diff) |
Add latest changes from gitlab-org/security/gitlab@13-9-stable-ee
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/git/wiki_page_version.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab/git/wiki_page_version.rb b/lib/gitlab/git/wiki_page_version.rb index efe39fa852c..1de0a0204cf 100644 --- a/lib/gitlab/git/wiki_page_version.rb +++ b/lib/gitlab/git/wiki_page_version.rb @@ -3,6 +3,8 @@ module Gitlab module Git class WikiPageVersion + include Gitlab::Utils::StrongMemoize + attr_reader :commit, :format def initialize(commit, format) @@ -12,9 +14,10 @@ module Gitlab delegate :message, :sha, :id, :author_name, :author_email, :authored_date, to: :commit - def author_url - user = ::User.find_by_any_email(author_email) - user.nil? ? "mailto:#{author_email}" : Gitlab::UrlBuilder.build(user) + def author + strong_memoize(:author) do + ::User.find_by_any_email(author_email) + end end end end |