Class: Nandi::MigrationGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



9
10
11
12
13
14
15
16
# File 'lib/generators/nandi/migration/migration_generator.rb', line 9

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