summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorKamil TrzciƄski <kamil@gitlab.com>2019-01-28 12:12:30 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2019-01-31 16:52:50 +0100
commitd4c7214799586a9b5063b0ea5b4327bbffe1170f (patch)
tree5e39656039d6f73e19b4cbc3575dba65d44aee4d /app/models/commit.rb
parent4b868ba8e71be9aa5591378555122d76c27ac777 (diff)
downloadgitlab-ce-d4c7214799586a9b5063b0ea5b4327bbffe1170f.tar.gz
[master] Pipelines section is available to unauthorized users
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 01f4c58daa1..982e13e2845 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -11,6 +11,7 @@ class Commit
include Mentionable
include Referable
include StaticModel
+ include Presentable
include ::Gitlab::Utils::StrongMemoize
attr_mentionable :safe_message, pipeline: :single_line
@@ -304,7 +305,9 @@ class Commit
end
def last_pipeline
- @last_pipeline ||= pipelines.last
+ strong_memoize(:last_pipeline) do
+ pipelines.last
+ end
end
def status(ref = nil)