Skip to content
Browse files

script/console uses RAILS_ENV environment variable if present. Closes #…

…2932.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3083 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ae76e22 commit 97d5f4acdfb986c5dc26f7c48518ef8a7d26f8bb @jeremy jeremy committed Nov 18, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +1 −1 railties/lib/commands/console.rb
View
2 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>]
View
2 railties/lib/commands/console.rb
@@ -12,7 +12,7 @@
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."

0 comments on commit 97d5f4a

Please sign in to comment.
Something went wrong with that request. Please try again.