Class: ActiveColumn::Generators::MigrationGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActiveColumn::Generators::MigrationGenerator
- Defined in:
- lib/active_column/generators/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
10 11 12 |
# File 'lib/active_column/generators/migration_generator.rb', line 10 def self. "rails g active_column:migration NAME" end |
.desc(description = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/active_column/generators/migration_generator.rb', line 14 def self.desc(description = nil) <<EOF Description: Create an empty Cassandra migration file in 'ks/migrate'. Very similar to Rails database migrations. Example: `rails g active_column:migration CreateFooColumnFamily` EOF end |
Instance Method Details
#create ⇒ Object
24 25 26 27 |
# File 'lib/active_column/generators/migration_generator.rb', line 24 def create = Time.now.utc.strftime("%Y%m%d%H%M%S") template 'migration.rb.erb', "ks/migrate/#{}_#{file_name.underscore}.rb" end |