aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/commands/destroy/destroy_command.rb
blob: 794673851d958753afb79d40e17aa94110696ed1 (plain) (tree)
1
2
3
4
5
6
7
8
9



                          
                                         



                                                        






                                            
                       
 
                                                                                                          



         
require "rails/generators"

module Rails
  module Command
    class DestroyCommand < Base # :nodoc:
      no_commands do
        def help
          Rails::Generators.help self.class.command_name
        end
      end

      def perform(*)
        generator = args.shift
        return help unless generator

        require_application_and_environment!
        load_generators

        Rails::Generators.invoke generator, args, behavior: :revoke, destination_root: Rails::Command.root
      end
    end
  end
end