Class: HasManyEmailsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/has_many_emails_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object


13
14
15
# File 'lib/generators/has_many_emails_generator.rb', line 13

def self.next_migration_number(path)
  Time.now.utc.to_s(:number)
end

Instance Method Details

#generate_migrationObject


17
18
19
# File 'lib/generators/has_many_emails_generator.rb', line 17

def generate_migration
  migration_template 'create_email_address.rb', "db/migrate/create_#{email_address_table_name}.rb"
end