From b5c4e391b1e25e198b96da819e4ad258eb9ae6f3 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 16 Jan 2020 13:52:29 +1100 Subject: [PATCH] chore: call name_like for all pacticipant searches --- lib/pact_broker/pacticipants/repository.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/pact_broker/pacticipants/repository.rb b/lib/pact_broker/pacticipants/repository.rb index 7f1438c07..32583f21a 100644 --- a/lib/pact_broker/pacticipants/repository.rb +++ b/lib/pact_broker/pacticipants/repository.rb @@ -10,13 +10,9 @@ class Repository include PactBroker::Repositories::Helpers def find_by_name name - if PactBroker.configuration.use_case_sensitive_resource_names - PactBroker::Domain::Pacticipant.where(name: name).single_record - else - pacticipants = PactBroker::Domain::Pacticipant.where(name_like(:name, name)).all - handle_multiple_pacticipants_found(name, pacticipants) if pacticipants.size > 1 - pacticipants.first - end + pacticipants = PactBroker::Domain::Pacticipant.where(name_like(:name, name)).all + handle_multiple_pacticipants_found(name, pacticipants) if pacticipants.size > 1 + pacticipants.first end def find_by_id id