aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/commands/console.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 39593f2f6c..b15d7b3883 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* script/console uses RAILS_ENV environment variable if present. #2932 [Blair Zajac <blair@orcaware.com>
+
* Windows: eliminate the socket option in database.yml. #2924 [Wayne Vucenic <waynev@gmail.com>]
* Eliminate nil from newly generated logfiles. #2927 [Blair Zajac <blair@orcaware.com>]
diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb
index 0aed60152c..6e61acb22f 100644
--- a/railties/lib/commands/console.rb
+++ b/railties/lib/commands/console.rb
@@ -12,7 +12,7 @@ libs = " -r irb/completion"
libs << " -r #{RAILS_ROOT}/config/environment"
libs << " -r console_sandbox" if options[:sandbox]
-ENV['RAILS_ENV'] = ARGV.first || 'development'
+ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
if options[:sandbox]
puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
puts "Any modifications you make will be rolled back on exit."