From 42bcbcb043cd6404fd75e71c1cd5a8c2abe23bc1 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 12 Oct 2005 12:41:23 +0000 Subject: 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 --- railties/lib/commands/runner.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/commands/runner.rb b/railties/lib/commands/runner.rb index 7d1b56e3f9..c7a70a1b0b 100644 --- a/railties/lib/commands/runner.rb +++ b/railties/lib/commands/runner.rb @@ -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) \ No newline at end of file +eval(ARGV.first) -- cgit v1.2.3