From 071f48b716ce2cd8a46219730afc307c258a9798 Mon Sep 17 00:00:00 2001 From: bastilian Date: Tue, 12 May 2009 21:01:20 +0200 Subject: Make sure db:drop doesn't fail when sqlite db is given by an absolute path [#1789 state:resolved] Signed-off-by: Pratik Naik --- railties/lib/tasks/databases.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 0fefc0433a..93aec674ab 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -440,7 +440,7 @@ def drop_database(config) ActiveRecord::Base.establish_connection(config) ActiveRecord::Base.connection.drop_database config['database'] when /^sqlite/ - FileUtils.rm(File.join(RAILS_ROOT, config['database'])) + FileUtils.rm((config['database'] =~ /^\// ? config['database'] : File.join(RAILS_ROOT, config['database']))) when 'postgresql' ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public')) ActiveRecord::Base.connection.drop_database config['database'] -- cgit v1.2.3