3 Star 0 Fork 10

src-openEuler/rubygem-activerecord

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rubygem-activerecord-7.0.4-remove-require-pathname-from-drop-method.patch 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
lyn 提交于 2023-08-18 09:52 . Upgrade to version 7.0.7
From e708599c85226e9ad107ebdad09a9e31f1b5388a Mon Sep 17 00:00:00 2001
From: Nicolas Iragorri Dominguez
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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rubygem-activerecord.git
[email protected]:src-openeuler/rubygem-activerecord.git
src-openeuler
rubygem-activerecord
rubygem-activerecord
master

搜索帮助