aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-10-12 12:41:23 +0000
committerJamis Buck <jamis@37signals.com>2005-10-12 12:41:23 +0000
commit42bcbcb043cd6404fd75e71c1cd5a8c2abe23bc1 (patch)
tree8818ebca056f006518a8c6da14ad4dd0e1a4f469 /railties/lib
parent7aa1ba7ff0f156ab726ff838957eeb2804d2df54 (diff)
downloadrails-42bcbcb043cd6404fd75e71c1cd5a8c2abe23bc1.tar.gz
rails-42bcbcb043cd6404fd75e71c1cd5a8c2abe23bc1.tar.bz2
rails-42bcbcb043cd6404fd75e71c1cd5a8c2abe23bc1.zip
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
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/commands/runner.rb8
1 files changed, 6 insertions, 2 deletions
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)