From 06fc38204ce459b20ed48ee1b0c617ae44cfcb46 Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Tue, 14 Feb 2023 17:56:19 +0000 Subject: [PATCH] refactor: use exists?, not where+present? to improve performance --- app/services/bulk_upload/lettings/row_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index dbf34bc0d..32e0b7607 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -329,7 +329,7 @@ private "ethnic" => field_43, } - LettingsLog.where(field_mappings).present? + LettingsLog.exists?(field_mappings) end def field_mapping_for_errors