From 8194ed6e627eac1c621db59e1ac2c3f01e40d099 Mon Sep 17 00:00:00 2001 From: Rashi Agarwal Date: Fri, 15 Jun 2018 19:59:45 +1000 Subject: [PATCH] fix: reverting safe navigation operator to chained calls. --- lib/pact/pact_broker/fetch_pacts.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pact/pact_broker/fetch_pacts.rb b/lib/pact/pact_broker/fetch_pacts.rb index 002a6afa..972fd602 100644 --- a/lib/pact/pact_broker/fetch_pacts.rb +++ b/lib/pact/pact_broker/fetch_pacts.rb @@ -34,11 +34,15 @@ def self.call(provider, tags, broker_base_url, basic_auth_options) def call get_index - tags&.any? ? get_tagged_pacts_for_provider : get_latest_pacts_for_provider + tag_exist ? get_tagged_pacts_for_provider : get_latest_pacts_for_provider end private + def tag_exist + tags && tags.any? + end + def get_tagged_pacts_for_provider tags.collect do |tag| link = get_link(tag)