Permalink
Browse files

"rails console t" must not load "production" but "test"

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 920765c commit 4d9b2da5f3e931db6293489ecbbc7ac07857a7cb @amatsuda amatsuda committed with josevalim Sep 2, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/console.rb
@@ -48,5 +48,5 @@ def start
# 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

0 comments on commit 4d9b2da

Please sign in to comment.