Skip to content

Commit

Permalink
fix connection not established error while running rake task
Browse files Browse the repository at this point in the history
db:schema:dump
  • Loading branch information
bhavinkamani committed May 21, 2011
1 parent e4bcd5e commit e9a2ff8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -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
Expand Down

0 comments on commit e9a2ff8

Please sign in to comment.