Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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".
  • Loading branch information...
commit f4ddc496da0b7c1907a3345343918d7b9b39f5c5 1 parent 9a38e73
Martin Grandrath Grandrath authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/railties/databases.rake
2  activerecord/lib/active_record/railties/databases.rake
View
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.