class TranslatableRecords::Generators::TranslationGenerator
Public Class Methods
next_migration_number(path)
click to toggle source
# File lib/generators/translation/translation_generator.rb, line 19 def self.next_migration_number(path) Time.now.utc.strftime '%Y%m%d%H%M%S' end
Public Instance Methods
create_migration_file()
click to toggle source
# File lib/generators/translation/translation_generator.rb, line 14 def create_migration_file @attributes = class_name.constantize.translations migration_template 'migration.rb', "db/migrate/create_#{singular_table_name}_translations.rb" end
create_model_file()
click to toggle source
# File lib/generators/translation/translation_generator.rb, line 10 def create_model_file template 'model.rb', "app/models/#{singular_table_name}_translation.rb" end