Sha256: 462b5647774c581867e27e038029fa784c89016ea1720714994b982f70d2ddf4
Contents?: true
Size: 555 Bytes
Versions: 15
Compression:
Stored size: 555 Bytes
Contents
class Ecm::Cms::Navigation < ActiveRecord::Base # associations has_many :ecm_cms_navigation_items, class_name: 'Ecm::Cms::NavigationItem', dependent: :destroy, foreign_key: 'ecm_cms_navigation_id' # validations validates :locale, inclusion: I18n.available_locales.map(&:to_s), allow_nil: true validates :name, presence: true, uniqueness: { scope: [:locale] } delegate :count, to: :ecm_cms_navigation_items, prefix: true def to_s "#{name} (#{locale})" end end
Version data entries
15 entries across 15 versions & 1 rubygems