diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-18 11:30:28 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-18 11:30:28 +0100 |
commit | 3bc0525ad90aa84ff864a0bc9c43e18ec5d5cd3d (patch) | |
tree | 36e3cc3e3c2dfce0d3271f129c2bf396c6c31576 /lib/gitlab/ci/status | |
parent | e66b0414cb0a81565937391252e841c777bf270b (diff) | |
download | gitlab-ce-3bc0525ad90aa84ff864a0bc9c43e18ec5d5cd3d.tar.gz |
Extract compound statuses method in status factory
Diffstat (limited to 'lib/gitlab/ci/status')
-rw-r--r-- | lib/gitlab/ci/status/factory.rb | 10 |
1 files 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) |