Sha256: f0721f6d0d0c1393ecf54ad60902e93675d6ac9b84836306e79f15b052a5a340

Contents?: true

Size: 811 Bytes

Versions: 7

Compression:

Stored size: 811 Bytes

Contents

class AwesomeTranslations::CacheDatabaseGenerator::TranslationKey < BazaModels::Model
  belongs_to :group, foreign_key: "group_id" # rubocop:disable Rails/RedundantForeignKey
  belongs_to :handler, foreign_key: "handler_id" # rubocop:disable Rails/RedundantForeignKey

  has_many :handler_translations,
    dependent: :destroy,
    foreign_key: "translation_key_id", # rubocop:disable Rails/RedundantForeignKey
    class_name: "AwesomeTranslations::CacheDatabaseGenerator::HandlerTranslation"

  has_many :translation_values,
    dependent: :destroy,
    foreign_key: "translation_key_id", # rubocop:disable Rails/RedundantForeignKey
    class_name: "AwesomeTranslations::CacheDatabaseGenerator::TranslationValue"

  validates_presence_of :group, :handler

  def last_key
    key.to_s.split(".").last
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
awesome_translations-0.0.66 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.65 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.64 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.63 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.62 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.61 lib/awesome_translations/cache_database_generator/translation_key.rb
awesome_translations-0.0.60 lib/awesome_translations/cache_database_generator/translation_key.rb