diff options
author | bastilian <sebastian.graessl@gmail.com> | 2009-05-12 21:01:20 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 01:54:08 +0100 |
commit | 071f48b716ce2cd8a46219730afc307c258a9798 (patch) | |
tree | c538df4d25180430a4d4c6359bf030028a11e90f /railties/lib | |
parent | 29096268ccce2b13e1490c8b673ffe0b498555fc (diff) | |
download | rails-071f48b716ce2cd8a46219730afc307c258a9798.tar.gz rails-071f48b716ce2cd8a46219730afc307c258a9798.tar.bz2 rails-071f48b716ce2cd8a46219730afc307c258a9798.zip |
Make sure db:drop doesn't fail when sqlite db is given by an absolute path [#1789 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/tasks/databases.rake | 2 |
1 files changed, 1 insertions, 1 deletions
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'] |