From b1434d2b9d0034470f6aee68c9b24168442099ac Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 26 Dec 2022 20:51:48 -0500 Subject: [PATCH] Tweak safeguard so that empty strings are handled correctly --- lib/database_cleaner/safeguard.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/database_cleaner/safeguard.rb b/lib/database_cleaner/safeguard.rb index 353d0a7..2664679 100644 --- a/lib/database_cleaner/safeguard.rb +++ b/lib/database_cleaner/safeguard.rb @@ -53,12 +53,11 @@ module DatabaseCleaner def remote?(url) return false unless url - parsed = URI.parse(url) return false if parsed.scheme == 'sqlite3:' host = parsed.host - return false unless host + return false if host.nil? || host.empty? return false if LOCAL.include?(host) return false if host.end_with? '.local' true