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



6
7
8
# File 'lib/generators/translated_attributes/translated_attributes_generator.rb', line 6

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

Instance Method Details

#create_migrationObject



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

def create_migration
  template = File.expand_path('../templates/migration.rb', __FILE__)
  migration_template template, 'db/migrate/add_translations.rb'
end