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

                                                                  
                                             
                                  



                 
                                                                                    
require "rails/generators"

#if no argument/-h/--help is passed to rails destroy command, then
#it generates the help associated.
if [nil, "-h", "--help"].include?(ARGV.first)
  Rails::Generators.help "destroy"
  exit
end

name = ARGV.shift
Rails::Generators.invoke name, ARGV, behavior: :revoke, destination_root: Rails.root