Sha256: e4ef72e6201a96c05a48a4e7588d7d239dedfd46ec58b932dc1673954f3b734c
Contents?: true
Size: 483 Bytes
Versions: 31
Compression:
Stored size: 483 Bytes
Contents
module Mobility module ActiveRecord # @abstract Subclass and set +table_name+ to implement for a particular column type. class Translation < ::ActiveRecord::Base self.abstract_class = true belongs_to :translatable, polymorphic: true, touch: true validates :key, presence: true, uniqueness: { scope: [:translatable_id, :translatable_type, :locale] } validates :translatable, presence: true validates :locale, presence: true end end end
Version data entries
31 entries across 31 versions & 1 rubygems