Class: HanamiId::Destroy::Auth

Inherits:
Hanami::CLI::Commands::Command
  • Object
show all
Defined in:
lib/hanami_id-generators/destroy/auth.rb

Instance Method Summary collapse

Instance Method Details

#call(app:, model:, mode:, **_options) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hanami_id-generators/destroy/auth.rb', line 23

def call(app:, model:, mode:, **_options)
  HanamiId.logger.info "Destroying #{app} app!"
  HanamiId.model_name = model
  Hanami::CLI::Commands::Destroy::App.new(
    command_name: "destroy app"
  ).call(app: app)

  remove_lib_app_directory(app)
  remove_default_migration
  return unless mode == "project"

  # remove_config
  remove_initializer
end