From 8dc8fd8445552a802f74e2946acb7918b965bbf3 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 31 Aug 2023 09:25:50 +1000 Subject: [PATCH] refactor: rename constants --- lib/pact_broker/matrix/repository.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pact_broker/matrix/repository.rb b/lib/pact_broker/matrix/repository.rb index 322182074..a2ddadf37 100644 --- a/lib/pact_broker/matrix/repository.rb +++ b/lib/pact_broker/matrix/repository.rb @@ -18,8 +18,8 @@ class Repository # Used when using table_print to output query results TP_COLS = [ :consumer_version_number, :pact_revision_number, :provider_version_number, :verification_number] - GROUP_BY_PROVIDER_VERSION_NUMBER = [:consumer_name, :consumer_version_number, :provider_name, :provider_version_number] - GROUP_BY_PROVIDER = [:consumer_name, :consumer_version_number, :provider_name] + GROUP_BY_CONSUMER_VERSION_AND_PROVIDER_VERSION = [:consumer_name, :consumer_version_number, :provider_name, :provider_version_number] + GROUP_BY_CONSUMER_VERSION_AND_PROVIDER = [:consumer_name, :consumer_version_number, :provider_name] GROUP_BY_CONSUMER_AND_PROVIDER = [:consumer_name, :provider_name] # THE METHOD for querying the Matrix @@ -89,8 +89,8 @@ def apply_success_filter(rows_with_latest_by_applied, options) def apply_latestby(options, lines) return lines unless options[:latestby] group_by_columns = case options[:latestby] - when "cvpv" then GROUP_BY_PROVIDER_VERSION_NUMBER - when "cvp" then GROUP_BY_PROVIDER + when "cvpv" then GROUP_BY_CONSUMER_VERSION_AND_PROVIDER_VERSION + when "cvp" then GROUP_BY_CONSUMER_VERSION_AND_PROVIDER when "cp" then GROUP_BY_CONSUMER_AND_PROVIDER end