From 3bc0525ad90aa84ff864a0bc9c43e18ec5d5cd3d Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 18 Jan 2017 11:30:28 +0100 Subject: Extract compound statuses method in status factory --- lib/gitlab/ci/status/factory.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/ci/status/factory.rb b/lib/gitlab/ci/status/factory.rb index 3da5ae4fc01..4d7c71ed469 100644 --- a/lib/gitlab/ci/status/factory.rb +++ b/lib/gitlab/ci/status/factory.rb @@ -12,9 +12,7 @@ module Gitlab if extended_statuses.none? core_status else - extended_statuses.inject(core_status) do |status, extended| - extended.new(status) - end + compound_extended_status end end @@ -25,6 +23,12 @@ module Gitlab .extend(self.class.common_helpers) end + def compound_extended_status + extended_statuses.inject(core_status) do |status, extended| + extended.new(status) + end + end + def extended_statuses return @extended_statuses if defined?(@extended_statuses) -- cgit v1.2.1