From f390eade5fd70615ba2ee8e089821bcf2d5f7b17 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Wed, 3 Feb 2010 19:50:51 +1100 Subject: Adding 'db' as a shortcut for dbconsole to the rails command --- railties/lib/rails/commands/rails.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/rails.rb b/railties/lib/rails/commands/rails.rb index 5f34876f1d..9597e2e7e6 100644 --- a/railties/lib/rails/commands/rails.rb +++ b/railties/lib/rails/commands/rails.rb @@ -6,13 +6,14 @@ HELP_TEXT = <<-EOT usage: rails COMMAND [ARGS] The most common rails commands are: - generate Generate new code (short-cut alias: "g") - console Start the Rails console (short-cut alias: "c") - server Start the Rails server (short-cut alias: "s") + generate Generate new code (short-cut alias: "g") + console Start the Rails console (short-cut alias: "c") + server Start the Rails server (short-cut alias: "s") + dbconsole Start a console for the database specified in config/database.yml + (short-cut alias: "db") In addition to those, there are: application Generate the Rails application code - dbconsole Start a console for the database specified in config/database.yml destroy Undo code generated with "generate" benchmarker See how fast a piece of code runs profiler Get profile information from a piece of code @@ -35,13 +36,13 @@ when 's', 'server' require 'rails/commands/server' Dir.chdir(ROOT_PATH) Rails::Server.start - -when 'application' - require 'rails/commands/application' -when 'dbconsole' +when 'db', 'dbconsole' require 'rails/commands/dbconsole' require APP_PATH Rails::DBConsole.start(Rails::Application) + +when 'application' + require 'rails/commands/application' when 'destroy' require ENV_PATH require 'rails/commands/destroy' -- cgit v1.2.3