Sha256: e63dba79c3253ea11ab0d15bed75ebbedfa4a3f8374d15dbb1065682034db736
Contents?: true
Size: 684 Bytes
Versions: 1
Compression:
Stored size: 684 Bytes
Contents
require 'rails/generators' module TranslatableRecords module Generators class TranslationGenerator < ::Rails::Generators::NamedBase include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) def create_model_file template 'model.rb', "app/models/#{singular_table_name}_translation.rb" end def create_migration_file @attributes = class_name.constantize.translations migration_template 'migration.rb', "db/migrate/create_#{singular_table_name}_translations.rb" end def self.next_migration_number(path) Time.now.utc.strftime '%Y%m%d%H%M%S' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
translatable_records-4.0.0.0 | lib/generators/translation/translation_generator.rb |