class CassandraMigrationGenerator

Public Instance Methods

generate_migration() click to toggle source

Interpolates template and creates migration in the application

Any public method in the generator is run automatically when the generator is run. To understand fully see asciicasts.com/episodes/218-making-generators-in-rails-3

# File lib/cassandra_migrations/railtie/generators/cassandra_migration/cassandra_migration_generator.rb, line 12
def generate_migration
  file_name = "#{Time.current.utc.strftime('%Y%m%d%H%M%S')}_#{migration_name.underscore}"
  @migration_class_name = migration_name.camelize
  
  template "empty_migration.rb.erb", "db/cassandra_migrate/#{file_name}.rb"  
end