Sha256: ef027494b7dd9b5d170b2cd56100044f2faed057bd7ed02b123b993f8025f757

Contents?: true

Size: 496 Bytes

Versions: 10

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

class TranslationText < ActiveRecord::Base
  belongs_to :translation_key, class_name: 'TranslationKey'
  validates_presence_of :locale
  validates_uniqueness_of :locale, scope: :translation_key_id
  attr_accessible :text, :locale, :translation_key, :translation_key_id if ActiveRecord::VERSION::MAJOR == 3 || defined?(ProtectedAttributes)
  after_update :expire_cache

  protected

  def expire_cache
    FastGettext.expire_cache_for(translation_key.key)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fast_gettext-4.1.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-4.0.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-3.1.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.3.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.2.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.1.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.0.3 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.0.2 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.0.1 lib/fast_gettext/translation_repository/db_models/translation_text.rb
fast_gettext-2.0.0 lib/fast_gettext/translation_repository/db_models/translation_text.rb