Sha256: 6451783dc84409a550d847185bbdc9b6b4b9041724d1a4350b7a5afe8e913f54

Contents?: true

Size: 614 Bytes

Versions: 2

Compression:

Stored size: 614 Bytes

Contents

module RocketCMS
  module Models
    module Menu
      extend ActiveSupport::Concern
      include RocketCMS::Model
      include Enableable
      include ManualSlug
      include RocketCMS.orm_specific('Menu')

      included do

        field :name, type: String, localize: RocketCMS.configuration.localize
        manual_slug :name
        
        after_save do
          Rails.cache.delete 'menus'
        end
        after_destroy do
          Rails.cache.delete 'menus'
        end

        has_and_belongs_to_many :pages, inverse_of: :menus
        alias_method :items, :pages
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.4 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.3 lib/rocket_cms/models/menu.rb