Skip to content

Instantly share code, notes, and snippets.

@yoones
Created May 19, 2019 20:16
Show Gist options
  • Save yoones/da4d906fd4ff86f4fd337c137bd7acb5 to your computer and use it in GitHub Desktop.
Save yoones/da4d906fd4ff86f4fd337c137bd7acb5 to your computer and use it in GitHub Desktop.
rails/commands
# frozen_string_literal: true
require "rails/command"
aliases = {
"g" => "generate",
"d" => "destroy",
"c" => "console",
"s" => "server",
"db" => "dbconsole",
"r" => "runner",
"t" => "test"
}
command = ARGV.shift
command = aliases[command] || command
Rails::Command.invoke command, ARGV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment