aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2011-01-16 07:47:41 +0900
committerSantiago Pastorino <santiago@wyeworks.com>2011-01-31 19:48:58 -0200
commit2e11213d62f25d41ccf77b3d0f5b69aad0bf165b (patch)
tree4fdbaf7bfdcfa19c229dc7351615a4c26df8c74d
parent57bc25c5f8129f57b08a2dc7c319b86778dd8a40 (diff)
downloadrails-2e11213d62f25d41ccf77b3d0f5b69aad0bf165b.tar.gz
rails-2e11213d62f25d41ccf77b3d0f5b69aad0bf165b.tar.bz2
rails-2e11213d62f25d41ccf77b3d0f5b69aad0bf165b.zip
"rails dbconsole t" must not load "production" but "test"
[#6293 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
-rw-r--r--railties/lib/rails/commands/dbconsole.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 300fd6da05..9dbc1699ee 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -119,5 +119,5 @@ end
# 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