Class: Nandi::MigrationGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
MultiDbGenerator
Defined in:
lib/generators/nandi/migration/migration_generator.rb

Instance Method Summary collapse

Methods included from MultiDbGenerator

included

Instance Method Details

#create_migration_fileObject



12
13
14
15
16
17
18
19
# File 'lib/generators/nandi/migration/migration_generator.rb', line 12

def create_migration_file
  timestamp = Time.now.utc.strftime("%Y%m%d%H%M%S")

  template(
    "migration.rb",
    "#{base_path}/#{timestamp}_#{file_name.underscore}.rb",
  )
end