From 2b0e993b355ae116cc4c09d642fea09c6bc0fd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Ksionek?= Date: Thu, 6 Jun 2019 16:27:57 +0200 Subject: Move call to separate method --- lib/gitlab/cycle_analytics/test_helper.rb | 12 ++++++++---- 1 file 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 -- cgit v1.2.1