summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/stage/seed.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-10 01:30:04 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-01-12 17:54:55 +0800
commit4f00a05152c105814f17a5f582d493435de96747 (patch)
tree76eab649b7c832afb47ad3e37ead6eb7a4bdaa93 /lib/gitlab/ci/stage/seed.rb
parent3fde958f36fa9c3bfa30ed1f73108e0640722926 (diff)
downloadgitlab-ce-4f00a05152c105814f17a5f582d493435de96747.tar.gz
Introduce PredicateMemoization cop and fix offenses
with StrongMemoize
Diffstat (limited to 'lib/gitlab/ci/stage/seed.rb')
-rw-r--r--lib/gitlab/ci/stage/seed.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/ci/stage/seed.rb b/lib/gitlab/ci/stage/seed.rb
index bc97aa63b02..f33c87f554d 100644
--- a/lib/gitlab/ci/stage/seed.rb
+++ b/lib/gitlab/ci/stage/seed.rb
@@ -2,6 +2,8 @@ module Gitlab
module Ci
module Stage
class Seed
+ include ::Gitlab::Utils::StrongMemoize
+
attr_reader :pipeline
delegate :project, to: :pipeline
@@ -50,7 +52,9 @@ module Gitlab
private
def protected_ref?
- @protected_ref ||= project.protected_for?(pipeline.ref)
+ strong_memoize(:protected_ref) do
+ project.protected_for?(pipeline.ref)
+ end
end
end
end