Module: SpreeMobility::CoreExt::Spree::TaxonDecorator
- Defined in:
- lib/spree_mobility/core_ext/spree/taxon_decorator.rb
Defined Under Namespace
Modules: TranslationMethods
Class Method Summary collapse
Class Method Details
.prepended(base) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/spree_mobility/core_ext/spree/taxon_decorator.rb', line 36 def self.prepended(base) base.include SpreeMobility::Translatable SpreeMobility.translates_for base, :name, :description, :meta_title, :meta_description, :meta_keywords, :permalink base.friendly_id :permalink, slug_column: :permalink, use: [:history, :mobility] base.translation_class.class_eval do include TranslationMethods validates :name, presence: true validate :name_uniqueness_validation length: { maximum: 255 }, allow_blank: true do validates :meta_keywords validates :meta_description validates :meta_title end validate :permalink_uniqueness_validation end end |