Sha256: 1a491c09f3d6dec41f6bcf88da15e2e5c9ad81962468f3f3d4c26005746efbd3

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

class AwesomeTranslations::CacheDatabaseGenerator::TranslationValue < BazaModels::Model
  belongs_to :translation_key, foreign_key: "translation_key_id", class_name: "AwesomeTranslations::CacheDatabaseGenerator::TranslationKey"

  validates_presence_of :translation_key

  delegate :key, to: :translation_key

  def calculated_translation_file_path
    "#{handler_translation.dir}/#{locale}.yml"
  end

  def handler_translation
    @handler_translation ||= AwesomeTranslations::CacheDatabaseGenerator::HandlerTranslation
      .find_by(translation_key_id: translation_key_id)
  end

  def migrate_to_awesome_translations_namespace!
    AwesomeTranslations::TranslationMigrator.new(
      translation_key: translation_key,
      handler_translation: handler_translation,
      translation_value: self
    ).execute
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
awesome_translations-0.0.25 lib/awesome_translations/cache_database_generator/translation_value.rb