Class: ActAsPageExtractor::Generators::MigrationGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/act_as_page_extractor/migration_generator.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_generator_rootObject



13
14
15
# File 'lib/generators/act_as_page_extractor/migration_generator.rb', line 13

def self.default_generator_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_migration_fileObject



17
18
19
20
21
22
# File 'lib/generators/act_as_page_extractor/migration_generator.rb', line 17

def create_migration_file
  migration_template 'create_extracted_pages_table.rb.erb', "db/migrate/create_#{page_extractor_table_name}.rb"
  migration_template 'add_page_extractor_fields_to_documents.rb.erb', "db/migrate/add_page_extractor_fields_to_#{documents_table_name}.rb"
  template "extracted_page.rb.erb", "app/models/extracted_page.rb"
  template "act_as_page_extractor.rb.erb", "config/initializers/act_as_page_extractor.rb"
end