Skip to content

Commit

Permalink
chore: de-duplicate pacticipant ids used in matrix query
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Apr 28, 2023
1 parent 37d1a4c commit a630389
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pact_broker/matrix/query_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def initialize(all_pacticipant_ids, specified_pacticipant_ids, pacticipant_ids,

def self.from_selectors(selectors)
most_specific_criteria = selectors.collect(&:most_specific_criterion)
all_pacticipant_ids = selectors.collect(&:pacticipant_id)
specified_pacticipant_ids = selectors.select(&:specified?).collect(&:pacticipant_id)
pacticipant_version_ids = collect_ids(most_specific_criteria, :pacticipant_version_id)
pacticipant_ids = collect_ids(most_specific_criteria, :pacticipant_id)
all_pacticipant_ids = selectors.collect(&:pacticipant_id).uniq
specified_pacticipant_ids = selectors.select(&:specified?).collect(&:pacticipant_id).uniq
pacticipant_version_ids = collect_ids(most_specific_criteria, :pacticipant_version_id).uniq
pacticipant_ids = collect_ids(most_specific_criteria, :pacticipant_id).uniq
QueryIds.new(all_pacticipant_ids, specified_pacticipant_ids, pacticipant_ids, pacticipant_version_ids)
end

Expand Down

0 comments on commit a630389

Please sign in to comment.