Class: ApprovalEngine::Generators::InstallGenerator

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

Overview

Copies the engine migrations into the host app and drops a configured initializer.

rails generate approval_engine:install

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



17
18
19
# File 'lib/generators/approval_engine/install/install_generator.rb', line 17

def self.next_migration_number(dirname)
  ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Instance Method Details

#copy_migrationsObject



25
26
27
# File 'lib/generators/approval_engine/install/install_generator.rb', line 25

def copy_migrations
  rake "approval_engine:install:migrations"
end

#create_initializerObject



21
22
23
# File 'lib/generators/approval_engine/install/install_generator.rb', line 21

def create_initializer
  template "approval_engine.rb", "config/initializers/approval_engine.rb"
end

#show_readmeObject



29
30
31
# File 'lib/generators/approval_engine/install/install_generator.rb', line 29

def show_readme
  readme "POST_INSTALL" if behavior == :invoke
end