Sha256: 84e96a87d2fae3a70244875a7ae56c3e158480db711dd8eb3a1518fce0572002

Contents?: true

Size: 612 Bytes

Versions: 1

Compression:

Stored size: 612 Bytes

Contents

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

      included do

        field :name, type: String, localize: true
        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
        manual_slug :name
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.2.1 lib/rocket_cms/models/menu.rb