From 2a5c116f12c7716399f5da3fe788f7e23ae67c4c Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 14 Dec 2016 14:54:59 +0900 Subject: make all rails commands work in engine Currently, all rails commands can be executed in engine, but `server`, `console`, `dbconsole` and `runner` do not work. This make all rails commands work in engine. Related to #22588 --- railties/lib/rails/engine/commands.rb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'railties/lib/rails/engine/commands.rb') diff --git a/railties/lib/rails/engine/commands.rb b/railties/lib/rails/engine/commands.rb index a23ae44b0b..b9ef63243a 100644 --- a/railties/lib/rails/engine/commands.rb +++ b/railties/lib/rails/engine/commands.rb @@ -1,12 +1,7 @@ -require "rails/command" +unless defined?(APP_PATH) + if File.exist?(File.expand_path("test/dummy/config/application.rb", ENGINE_ROOT)) + APP_PATH = File.expand_path("test/dummy/config/application", ENGINE_ROOT) + end +end -aliases = { - "g" => "generate", - "d" => "destroy", - "t" => "test" -} - -command = ARGV.shift -command = aliases[command] || command - -Rails::Command.invoke command, ARGV +require "rails/commands" -- cgit v1.2.3