diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-02-14 09:00:18 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-02-14 09:00:19 -0200 |
commit | 4b44c20e5a9bb105dd913cc3849d224ac71814ab (patch) | |
tree | b0fdaa7bb55938c4d066f4d88c99ebbdfe29d5f0 /activerecord | |
parent | 7f6ee93b0e7933c20e83e84004bb763f03c18404 (diff) | |
download | rails-4b44c20e5a9bb105dd913cc3849d224ac71814ab.tar.gz rails-4b44c20e5a9bb105dd913cc3849d224ac71814ab.tar.bz2 rails-4b44c20e5a9bb105dd913cc3849d224ac71814ab.zip |
Always reenable _dump task in AR databases rake. Closes #5030
This allows the internal :_dump task to be called as many times as
required. For instance, `rake db:migrate:redo` calls two tasks that
internally call :_dump, and without reenabling it to be reinvoked,
the database was left in incorrect state.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 821410f42c..067117a465 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -162,6 +162,9 @@ db_namespace = namespace :db do else raise "unknown schema format #{ActiveRecord::Base.schema_format}" end + # Allow this task to be called as many times as required. An example is the + # migrate:redo task, which calls other two internally that depend on this one. + db_namespace['_dump'].reenable end namespace :migrate do @@ -612,7 +615,7 @@ def firebird_db_string(config) end def set_psql_env(config) - ENV['PGHOST'] = config['host'] if config['host'] + ENV['PGHOST'] = config['host'] if config['host'] ENV['PGPORT'] = config['port'].to_s if config['port'] ENV['PGPASSWORD'] = config['password'].to_s if config['password'] ENV['PGUSER'] = config['username'].to_s if config['username'] |