Skip to content

Commit

Permalink
fix: correct logic for finding pacticipants by name when the name con…
Browse files Browse the repository at this point in the history
…tains an underscore
  • Loading branch information
bethesque committed Jan 16, 2020
1 parent 0a6c7dd commit 6d975eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/repositories/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def name_like column_name, value
if PactBroker.configuration.use_case_sensitive_resource_names
if mysql?
# sigh, mysql, this is the only way to perform a case sensitive search
Sequel.escaped_like(column_name, value)
Sequel.like(column_name, value.gsub("_", "\\_"), { case_insensitive: false })
else
{ column_name => value }
end
else
{ Sequel.function(:lower, column_name) => value.downcase }
Sequel.like(column_name, value.gsub("_", "\\_"), { case_insensitive: true })
end
end

Expand Down

0 comments on commit 6d975eb

Please sign in to comment.