Class: Exekutor::InstallGenerator

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

Overview

Generates the initializer and migrations

Constant Summary collapse

TEMPLATE_DIR =
File.join(__dir__, "templates/install")

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject

Creates the initializer file at config/initializers/exekutor.rb



16
17
18
# File 'lib/generators/exekutor/install_generator.rb', line 16

def create_initializer_file
  template "initializers/exekutor.rb.erb", "config/initializers/exekutor.rb"
end

#create_migration_fileObject

Creates the migration file in the migrations folder



21
22
23
24
25
# File 'lib/generators/exekutor/install_generator.rb', line 21

def create_migration_file
  migration_template "migrations/create_exekutor_schema.rb.erb",
                     File.join(db_migrate_path, "create_exekutor_schema.rb")
  create_fx_files
end