Permalink
Browse files

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

[#6293 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 57bc25c commit 2e11213d62f25d41ccf77b3d0f5b69aad0bf165b @amatsuda amatsuda committed with spastorino Jan 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/dbconsole.rb
View
2 railties/lib/rails/commands/dbconsole.rb
@@ -119,5 +119,5 @@ def find_cmd(*commands)
# Has to set the RAILS_ENV before config/application is required
if ARGV.first && !ARGV.first.index("-") && env = ARGV.first
- 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

3 comments on commit 2e11213

@dmathieu

Also known as the github syndrom ! https://github.com/blog/744-today-s-outage :-)

@sobrinho

What about custom environments like "rails dbconsole staging"?

@spastorino
Ruby on Rails member

feel free to test it and provide a patch if it's wrong ;)

Please sign in to comment.