1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merged pull request #279 from miloops/434d757.

Fix console to accept [environment] [options] as specified in docs.
This commit is contained in:
José Valim 2011-04-26 11:15:42 -07:00
commit e36befbdd7

View file

@ -51,6 +51,6 @@ module Rails
end end
# Has to set the RAILS_ENV before config/application is required # 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 ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
end end