diff options
author | Bhavin Kamani <bhavinkamani@gmail.com> | 2011-05-21 15:50:25 +0530 |
---|---|---|
committer | Bhavin Kamani <bhavinkamani@gmail.com> | 2011-05-21 15:51:07 +0530 |
commit | e9a2ff8bb7fbc81c35bc6c725d7cf6cb52c53f5a (patch) | |
tree | 848b92c1f1412e984b392ca51fd2a31116cf5126 /activerecord/lib | |
parent | e4bcd5e7eb21905f66a2eec06cab874a312b787a (diff) | |
download | rails-e9a2ff8bb7fbc81c35bc6c725d7cf6cb52c53f5a.tar.gz rails-e9a2ff8bb7fbc81c35bc6c725d7cf6cb52c53f5a.tar.bz2 rails-e9a2ff8bb7fbc81c35bc6c725d7cf6cb52c53f5a.zip |
fix connection not established error while running rake task
db:schema:dump
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 85ad43b35f..a0ed14314e 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/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 |