From 50f7cd3e4fe18c742447e29aceb8f5e055e172bd Mon Sep 17 00:00:00 2001 From: Andrei Kulakov Date: Mon, 8 Nov 2010 03:09:35 +0200 Subject: [PATCH] Fix dbconsole arguments order mismatch --- railties/lib/rails/commands/dbconsole.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 14d245a..eb0d70b 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -112,6 +112,6 @@ module Rails end # Has to set the RAILS_ENV before config/application is required -if ARGV.first && !ARGV.first.index("-") && env = ARGV.first +if ARGV.last && !ARGV.last.index("-") && env = ARGV.last ENV['RAILS_ENV'] = %w(production development test).find { |e| e.index(env) } || env end -- 1.7.3.2