summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMałgorzata Ksionek <mksionek@gitlab.com>2019-06-06 16:27:57 +0200
committerMałgorzata Ksionek <mksionek@gitlab.com>2019-06-14 13:26:27 +0200
commit2b0e993b355ae116cc4c09d642fea09c6bc0fd1f (patch)
tree940076bd44f9c7c6989cd8e146026bbe35b98ab0
parentf8542c076fa0e7c589de2717373c4cf37815a54f (diff)
downloadgitlab-ce-2b0e993b355ae116cc4c09d642fea09c6bc0fd1f.tar.gz
Move call to separate method
-rw-r--r--lib/gitlab/cycle_analytics/test_helper.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/gitlab/cycle_analytics/test_helper.rb b/lib/gitlab/cycle_analytics/test_helper.rb
index 287b5fc5cbd..9bd2d83fcdc 100644
--- a/lib/gitlab/cycle_analytics/test_helper.rb
+++ b/lib/gitlab/cycle_analytics/test_helper.rb
@@ -3,15 +3,19 @@
module Gitlab
module CycleAnalytics
module TestHelper
- # rubocop:disable Gitlab/ModuleWithInstanceVariables
def stage_query(project_ids)
- if @options[:branch]
- super(project_ids).where(build_table[:ref].eq(@options[:branch]))
+ if branch
+ super(project_ids).where(build_table[:ref].eq(branch))
else
super(project_ids)
end
end
- # rubocop:enable Gitlab/ModuleWithInstanceVariables
+
+ private
+
+ def branch
+ @branch ||= @options[:branch]
+ end
end
end
end