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:
commit
e36befbdd7
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue