Sha256: 90defbd384d29d7bdf87d36bd3aa637cf6b89aec810c7e227129864af7c2c8fc
Contents?: true
Size: 736 Bytes
Versions: 29
Compression:
Stored size: 736 Bytes
Contents
module Tenon module Generators class I18nMigrationsGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) def copy_files timestamp = Time.now.strftime('%Y%m%d%H%M%S') template('migration.rb', File.join('db/migrate', "#{timestamp}_add_i18n_fields_#{file_hash.capitalize}.rb")) end private def yaml @yaml ||= YAML.load_file(File.join(Rails.root, 'config', 'i18n_fields.yml')).symbolize_keys end def languages Tenon.config.languages.values end def tables yaml[:tables] end def file_hash require 'digest/md5' Digest::MD5.hexdigest(yaml.to_s) end end end end
Version data entries
29 entries across 29 versions & 1 rubygems