Honor the runner -e toggle even if the RAILS_ENV constant has already been set
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2538 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
7aa1ba7ff0
commit
42bcbcb043
|
@ -20,7 +20,11 @@ ARGV.options do |opts|
|
|||
opts.parse!
|
||||
end
|
||||
|
||||
ENV["RAILS_ENV"] = options[:environment]
|
||||
if defined?(RAILS_ENV)
|
||||
RAILS_ENV.replace(options[:environment])
|
||||
else
|
||||
ENV["RAILS_ENV"] = options[:environment]
|
||||
end
|
||||
|
||||
require RAILS_ROOT + '/config/environment'
|
||||
eval(ARGV.first)
|
||||
eval(ARGV.first)
|
||||
|
|
Loading…
Reference in New Issue