Permalink
Browse files

fix connection not established error while running rake task

db:schema:dump
  • Loading branch information...
1 parent 6c0beb5 commit 5d7ed7a056260c314d1b412a80707ab573e10b4c @bhavinkamani bhavinkamani committed with tenderlove May 21, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/railties/databases.rake
@@ -333,6 +333,7 @@ namespace :db do
task :dump => :environment 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
Rake::Task["db:schema:dump"].reenable

0 comments on commit 5d7ed7a

Please sign in to comment.