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



                          

                                         














                                                                                                 
require "rails/generators"

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

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

        require_application_and_environment!
        Rails.application.load_generators

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