Sha256: 8a9d3f12404fe903055aa5f4cb4ab28eec58789d0e0dfe2ab1bc0341f211ff8a
Contents?: true
Size: 643 Bytes
Versions: 12
Compression:
Stored size: 643 Bytes
Contents
# frozen_string_literal: true module Katalyst module Navigation # STI base class for menu items (headings, links and buttons) class Item < ApplicationRecord belongs_to :menu, inverse_of: :items, class_name: "Katalyst::Navigation::Menu" after_initialize :initialize_tree attr_accessor :parent, :children, :index, :depth def self.permitted_params %i[ title visible type ] end def layout? is_a? Layout end private def initialize_tree self.parent ||= nil self.children ||= [] end end end end
Version data entries
12 entries across 12 versions & 1 rubygems