Module: SpreeMobility::CoreExt::Spree::TaxonomyDecorator

Defined in:
lib/spree_mobility/core_ext/spree/taxonomy_decorator.rb

Defined Under Namespace

Modules: TranslationMethods

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/spree_mobility/core_ext/spree/taxonomy_decorator.rb', line 19

def self.prepended(base)
  base.include SpreeMobility::Translatable
  SpreeMobility.translates_for base, :name

  base.translation_class.class_eval do
    include TranslationMethods
    validates :name, presence: true
    validate :name_uniqueness_validation
  end
end