diff options
author | Damien Mathieu <42@dmathieu.com> | 2014-01-08 11:08:08 +0100 |
---|---|---|
committer | Damien Mathieu <42@dmathieu.com> | 2014-01-08 14:37:07 +0100 |
commit | a334425caff9b2140d5e99fcfc2eb8c4ab10bdfa (patch) | |
tree | 45e2b00b6b57f54ae268d6eaf76de04ca3110a38 /activerecord/lib/active_record/tasks | |
parent | a03fed88f780922e3a3ab7b22af945f29a711ae4 (diff) | |
download | rails-a334425caff9b2140d5e99fcfc2eb8c4ab10bdfa.tar.gz rails-a334425caff9b2140d5e99fcfc2eb8c4ab10bdfa.tar.bz2 rails-a334425caff9b2140d5e99fcfc2eb8c4ab10bdfa.zip |
create/drop test and development databases only if RAILS_ENV is nil
Closes #13625
Diffstat (limited to 'activerecord/lib/active_record/tasks')
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index afd493011e..6ce0495f6f 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -201,7 +201,8 @@ module ActiveRecord def each_current_configuration(environment) environments = [environment] - environments << 'test' if environment == 'development' + # add test environment only if no RAILS_ENV was specified. + environments << 'test' if environment == 'development' && ENV['RAILS_ENV'].nil? configurations = ActiveRecord::Base.configurations.values_at(*environments) configurations.compact.each do |configuration| |