Skip to content

Commit

Permalink
feat(index): sort verifications by execution date
Browse files Browse the repository at this point in the history
Have found a lot of provider versions with nil order, need to investigate why
  • Loading branch information
bethesque committed Feb 8, 2018
1 parent 117c89b commit 2523982
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pact_broker/index/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def self.find_index_items options = {}
tag_names.collect do | tag_name |
verification_repository.find_latest_verification_for row.consumer_name, row.provider_name, tag_name
end.compact.sort do | v1, v2 |
v1.provider_version.order <=> v2.provider_version.order
# Some provider versions have nil orders, not sure why
# Sort by execution_date instead of order
v1.execution_date <=> v2.execution_date
end.last
end

Expand Down

0 comments on commit 2523982

Please sign in to comment.