Class: Smailer::MigrationGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/smailer/migration_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



14
15
16
# File 'lib/generators/smailer/migration_generator.rb', line 14

def self.next_migration_number(path)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#generate_migrationObject



18
19
20
21
22
# File 'lib/generators/smailer/migration_generator.rb', line 18

def generate_migration
  file_name       = 'create_smailer_tables'

  migration_template 'migration.rb.erb', "db/migrate/#{file_name}.rb"
end