Class: Deimos::Generators::BulkImportIdGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration, Rails::Generators::Migration
Defined in:
lib/generators/deimos/bulk_import_id_generator.rb

Overview

Generator for ActiveRecord model and migration.

Instance Method Summary collapse

Instance Method Details

#generateObject

For a given table_name and column_name, create a migration to add the column column_name defaults to bulk_import_id



44
45
46
47
48
# File 'lib/generators/deimos/bulk_import_id_generator.rb', line 44

def generate
  Rails.logger.info("Arguments: #{table_name},#{column_name}")
  migration_template('migration.rb',
                     "#{db_migrate_path}/add_#{column_name}_column_to_#{table_name}.rb")
end