Update to Rails 2.3.8
This commit is contained in:
parent
6677b46cb4
commit
f0635301aa
429 changed files with 17683 additions and 4047 deletions
28
vendor/rails/railties/lib/tasks/databases.rake
vendored
28
vendor/rails/railties/lib/tasks/databases.rake
vendored
|
@ -94,11 +94,7 @@ namespace :db do
|
|||
desc 'Drops the database for the current RAILS_ENV'
|
||||
task :drop => :load_config do
|
||||
config = ActiveRecord::Base.configurations[RAILS_ENV || 'development']
|
||||
begin
|
||||
drop_database(config)
|
||||
rescue Exception => e
|
||||
puts "Couldn't drop #{config['database']} : #{e.inspect}"
|
||||
end
|
||||
drop_database(config)
|
||||
end
|
||||
|
||||
def local_database?(config, &block)
|
||||
|
@ -410,15 +406,19 @@ namespace :db do
|
|||
end
|
||||
|
||||
def drop_database(config)
|
||||
case config['adapter']
|
||||
when 'mysql'
|
||||
ActiveRecord::Base.establish_connection(config)
|
||||
ActiveRecord::Base.connection.drop_database config['database']
|
||||
when /^sqlite/
|
||||
FileUtils.rm(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']
|
||||
begin
|
||||
case config['adapter']
|
||||
when 'mysql'
|
||||
ActiveRecord::Base.establish_connection(config)
|
||||
ActiveRecord::Base.connection.drop_database config['database']
|
||||
when /^sqlite/
|
||||
FileUtils.rm(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']
|
||||
end
|
||||
rescue Exception => e
|
||||
puts "Couldn't drop #{config['database']} : #{e.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue