Permalink
Browse files

fix connection not established error while running rake task

db:schema:dump
(cherry picked from commit e9a2ff8)
  • Loading branch information...
1 parent a40833c commit 696a94baa9c377711752110f62f9f49dd2f4f42c @bhavinkamani bhavinkamani committed with pixeltrix May 21, 2011
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 696a94b

Please sign in to comment.