From 434d75705f84337c97c2e5360a7586c7373c923b Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Thu, 14 Apr 2011 23:00:28 -0300 Subject: Fix console to accept [environment] [options] as specified in docs. --- railties/lib/rails/commands/console.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index 2b7faf9715..dfd3c654ff 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -51,6 +51,6 @@ module Rails end # 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 +if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift # has to shift the env ARGV so IRB doesn't freak ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env end -- cgit v1.2.3