aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/generate/generate_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands/generate/generate_command.rb')
-rw-r--r--railties/lib/rails/commands/generate/generate_command.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/generate/generate_command.rb b/railties/lib/rails/commands/generate/generate_command.rb
index b381ca85b9..73f627637d 100644
--- a/railties/lib/rails/commands/generate/generate_command.rb
+++ b/railties/lib/rails/commands/generate/generate_command.rb
@@ -1,10 +1,17 @@
-require "rails/generators"
+# frozen_string_literal: true
+
+require_relative "../../generators"
module Rails
module Command
- class GenerateCommand < Base
- def help # :nodoc:
- Rails::Generators.help self.class.command_name
+ class GenerateCommand < Base # :nodoc:
+ no_commands do
+ def help
+ require_application_and_environment!
+ load_generators
+
+ Rails::Generators.help self.class.command_name
+ end
end
def perform(*)
@@ -14,6 +21,8 @@ module Rails
require_application_and_environment!
load_generators
+ ARGV.shift
+
Rails::Generators.invoke generator, args, behavior: :invoke, destination_root: Rails::Command.root
end
end