Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 2e11213d62f25d41ccf77b3d0f5b69aad0bf165b 1 parent 57bc25c
@amatsuda amatsuda authored spastorino committed
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
Collaborator

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

@sobrinho

What about custom environments like "rails dbconsole staging"?

@spastorino
Owner

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

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