Skip to content

Commit

Permalink
feat(matrix): fix matrix data types for MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Nov 6, 2017
1 parent cf5219c commit 42c5478
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/pact_broker/matrix/latest_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 42c5478

Please sign in to comment.