diff options
author | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-06-06 16:27:57 +0200 |
---|---|---|
committer | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-06-14 13:26:27 +0200 |
commit | 2b0e993b355ae116cc4c09d642fea09c6bc0fd1f (patch) | |
tree | 940076bd44f9c7c6989cd8e146026bbe35b98ab0 | |
parent | f8542c076fa0e7c589de2717373c4cf37815a54f (diff) | |
download | gitlab-ce-2b0e993b355ae116cc4c09d642fea09c6bc0fd1f.tar.gz |
Move call to separate method
-rw-r--r-- | lib/gitlab/cycle_analytics/test_helper.rb | 12 |
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 |