diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/commands/console.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb index 8b35a8d296..5abdb49273 100644 --- a/railties/lib/commands/console.rb +++ b/railties/lib/commands/console.rb @@ -15,7 +15,14 @@ libs << " -r console_app" libs << " -r console_sandbox" if options[:sandbox] libs << " -r console_with_helpers" -ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development' +ENV['RAILS_ENV'] = case ARGV.first + when "p": "production" + when "d": "development" + when "t": "test" + else + ARGV.first || ENV['RAILS_ENV'] || 'development' +end + if options[:sandbox] puts "Loading #{ENV['RAILS_ENV']} environment in sandbox." puts "Any modifications you make will be rolled back on exit." |