Skip to content

Commit

Permalink
Merged pull request rails#278 from miloops/fix_console.
Browse files Browse the repository at this point in the history
Fix console to accept [environment] [options] as specified in docs.
  • Loading branch information
josevalim committed Apr 26, 2011
2 parents 922fb1d + 7d2f472 commit 8dcaf4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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 8dcaf4d

Please sign in to comment.