diff --git a/lib/pact_broker/matrix/latest_row.rb b/lib/pact_broker/matrix/latest_row.rb index fe3aca6e8..8a62f324c 100644 --- a/lib/pact_broker/matrix/latest_row.rb +++ b/lib/pact_broker/matrix/latest_row.rb @@ -2,11 +2,23 @@ module PactBroker module Matrix - # Latest pact revision for each consumer version => latest verification - class LatestRow < Row set_dataset(:latest_matrix) + + # For some reason, with MySQL, the success column value + # comes back as an integer rather than a boolean + # for the latest_matrix view (but not the matrix view!) + # Maybe something to do with the union? + # Haven't investigated as this is an easy enough fix. + def success + value = super + value.nil? ? nil : value == true || value == 1 + end + + def values + super.merge(success: success) + end end end end