Skip to content

Commit

Permalink
refactor: rename constants
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Aug 30, 2023
1 parent 5d50393 commit 8dc8fd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pact_broker/matrix/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8dc8fd8

Please sign in to comment.