aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2010-09-02 12:05:34 +0900
committerJosé Valim <jose.valim@gmail.com>2010-09-02 11:50:31 +0200
commit4d9b2da5f3e931db6293489ecbbc7ac07857a7cb (patch)
tree96aef2a7161143c3a2615210136bb7f343820be4 /railties
parent920765c4c223ee951312e371722b812710463677 (diff)
downloadrails-4d9b2da5f3e931db6293489ecbbc7ac07857a7cb.tar.gz
rails-4d9b2da5f3e931db6293489ecbbc7ac07857a7cb.tar.bz2
rails-4d9b2da5f3e931db6293489ecbbc7ac07857a7cb.zip
"rails console t" must not load "production" but "test"
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/commands/console.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb
index 834a120c01..de2f190ad5 100644
--- a/railties/lib/rails/commands/console.rb
+++ b/railties/lib/rails/commands/console.rb
@@ -48,5 +48,5 @@ end
# Has to set the RAILS_ENV before config/application is required
if ARGV.first && !ARGV.first.index("-") && env = ARGV.pop # has to pop the env ARGV so IRB doesn't freak
- ENV['RAILS_ENV'] = %w(production development test).find { |e| e.index(env) } || env
+ ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
end