diff options
author | Martin Grandrath <mg@insfx.com> | 2012-10-18 10:56:44 +0200 |
---|---|---|
committer | Martin Grandrath <mg@insfx.com> | 2012-10-18 10:57:30 +0200 |
commit | f4ddc496da0b7c1907a3345343918d7b9b39f5c5 (patch) | |
tree | a69b308dcd112acd9da409d3412ecda7d16fce8b /activerecord | |
parent | 9a38e73c631f4358b4863849ec16c84f6c876225 (diff) | |
download | rails-f4ddc496da0b7c1907a3345343918d7b9b39f5c5.tar.gz rails-f4ddc496da0b7c1907a3345343918d7b9b39f5c5.tar.bz2 rails-f4ddc496da0b7c1907a3345343918d7b9b39f5c5.zip |
Use `Rails.env` instead of `ENV['RAILS_ENV']`; #7951
`ENV['RAILS_ENV']` is not defined unless explicitly specified on the
command line when running `rake db:structure:load`. This patch lets
the rake task retrieve the environment from `Rails.env` which defaults
to "development".
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 6d43b232ad..987bb558e5 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -412,7 +412,7 @@ db_namespace = namespace :db do # desc "Recreate the databases from the structure.sql file" task :load => [:environment, :load_config] do - env = ENV['RAILS_ENV'] || 'test' + env = Rails.env abcs = ActiveRecord::Base.configurations filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") |