Class: TranslatedAttributesGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



8
9
10
# File 'lib/generators/translated_attributes/translated_attributes_generator.rb', line 8

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

Instance Method Details

#create_migrationObject



12
13
14
# File 'lib/generators/translated_attributes/translated_attributes_generator.rb', line 12

def create_migration
  migration_template "#{self.class.source_root}/migration.rb", File.join('db/migrate', "add_translations.rb")
end