This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/models/category_lang.rb
2021-08-23 10:26:02 +02:00

17 lines
354 B
Ruby

class CategoryLang < ApplicationRecord
belongs_to :lang_site
belongs_to :category
validates :name, :presence => true, :uniqueness => {:scope => :lang_site_id}
validates :slug, :presence => true, :uniqueness => {:scope => :lang_site_id}
before_validation do
self.slug = self.name.to_slug
#self.validate_permalink
end
end