Class: MaintenanceTasks::InstallGenerator Private

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/maintenance_tasks/install_generator.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Generator used to set up the engine in the host application. It handles mounting the engine and installing migrations.

Instance Method Summary collapse

Instance Method Details

#install_migrationsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Copies engine migrations to host application and migrates the database



17
18
19
20
# File 'lib/generators/maintenance_tasks/install_generator.rb', line 17

def install_migrations
  rake("maintenance_tasks:install:migrations")
  rake("db:migrate")
end

#mount_engineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Mounts the engine in the host application’s config/routes.rb



12
13
14
# File 'lib/generators/maintenance_tasks/install_generator.rb', line 12

def mount_engine
  route("mount MaintenanceTasks::Engine, at: \"/maintenance_tasks\"")
end