Sha256: bfa8a99babda432e46c87afd93c0d3bb7f478ccaa234e7bc1c17765eb219c915

Contents?: true

Size: 570 Bytes

Versions: 19

Compression:

Stored size: 570 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
        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

19 entries across 19 versions & 1 rubygems

Version Path
ack_rocket_cms-0.9.2 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.9.1.3 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.9.1.2 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.9.1.1 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.9.1 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.9 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.8.2 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.8.0 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.7.1 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.7 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.6.4 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.6.3 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.6.2 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.6.1 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.6 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.5.2 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.5.1 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.5 lib/rocket_cms/models/menu.rb
ack_rocket_cms-0.7.4.1 lib/rocket_cms/models/menu.rb