Class: Keinaufwand::Sync::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/generators/keinaufwand/sync/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_media_routeObject



26
27
28
29
30
# File 'lib/generators/keinaufwand/sync/install/install_generator.rb', line 26

def add_media_route
  return unless options[:media_route]

  route %(get "media/:id", to: "keinaufwand/assets#show", as: :keinaufwand_asset)
end

#add_webhook_routeObject



20
21
22
23
24
# File 'lib/generators/keinaufwand/sync/install/install_generator.rb', line 20

def add_webhook_route
  return unless options[:webhook_route]

  route %(mount Keinaufwand::Sync::Engine => "/webhooks/keinaufwand", as: :keinaufwand_sync)
end

#copy_migrationsObject



14
15
16
17
18
# File 'lib/generators/keinaufwand/sync/install/install_generator.rb', line 14

def copy_migrations
  migration_template "create_keinaufwand_sync_tables.rb", "db/migrate/create_keinaufwand_sync_tables.rb"
  migration_template "create_keinaufwand_assets.rb", "db/migrate/create_keinaufwand_assets.rb"
  migration_template "create_keinaufwand_webhook_receipts.rb", "db/migrate/create_keinaufwand_webhook_receipts.rb"
end