Navigation Menu

Skip to content

Commit

Permalink
Fix console to accept [environment] [options] as specified in docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
miloops committed Apr 15, 2011
1 parent 3d44e45 commit 434d757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/console.rb
Expand Up @@ -51,6 +51,6 @@ def start
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

0 comments on commit 434d757

Please sign in to comment.