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:
Diffstat (limited to 'lib/gitlab/git/wiki_page_version.rb')
-rw-r--r--lib/gitlab/git/wiki_page_version.rb9
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