class Nrb::Commands::Destroy

This command destroys a resource, and if it is a model, it also destroys the correspnding create migration file.

Public Instance Methods

destroy_migration() click to toggle source
# File lib/nrb/commands/destroy.rb, line 12
def destroy_migration
  return false unless resource == 'model'
  prefix = 'db/migrate/*_create_'
  migration_file = Dir["#{prefix}#{name.underscore.pluralize}.rb"].first
  remove_file(migration_file, opts) if migration_file
end
destroy_resource() click to toggle source
# File lib/nrb/commands/destroy.rb, line 8
def destroy_resource
  remove_file target("#{name.underscore}.rb"), opts
end