module Sis module Core class Menu < ApplicationRecord has_and_belongs_to_many :user_roles belongs_to :application_module belongs_to :parent, class_name: 'Sis::Core::Menu', optional: true has_many :children, class_name: 'Sis::Core::Menu', foreign_key: 'parent_id' validates :text, presence: true end end end