From e708599c85226e9ad107ebdad09a9e31f1b5388a Mon Sep 17 00:00:00 2001
From: Nicolas Iragorri Dominguez
 <nicolasiragorridominguez@Nicolass-Mac-Studio.local>
Date: Tue, 27 Dec 2022 01:24:19 +0100
Subject: [PATCH] [issue-46741] remove `require pathname` from `drop` method

---
 .../tasks/sqlite_database_tasks.rb            |  6 +--

diff --git a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb b/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
index d920d874ef308..fdfa299fa0e8c 100644
--- a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
@@ -22,10 +22,8 @@ def create
       end
 
       def drop
-        require "pathname"
-        path = Pathname.new(db_config.database)
-        file = path.absolute? ? path.to_s : File.join(root, path)
-
+        db_path = db_config.database
+        file = File.absolute_path?(db_path) ? db_path : File.join(root, db_path)
         FileUtils.rm(file)
       rescue Errno::ENOENT => error
         raise NoDatabaseError.new(error.message)
