Permalink
Browse files

fix connection not established error while running rake task

db:schema:dump
  • Loading branch information...
bhavinkamani committed May 21, 2011
1 parent e4bcd5e commit e9a2ff8bb7fbc81c35bc6c725d7cf6cb52c53f5a
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/railties/databases.rake
@@ -338,6 +338,7 @@ db_namespace = namespace :db do
task :dump => :load_config do
require 'active_record/schema_dumper'
File.open(ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb", "w") do |file|
+ ActiveRecord::Base.establish_connection(Rails.env)
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
end
db_namespace['schema:dump'].reenable

0 comments on commit e9a2ff8

Please sign in to comment.