Sha256: d3d1f802691c089e2a22b7fd8af39da5f8c5d383d1d53659ead24c297bb93ee6

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

module Enjoy
  module Admin
    module Menu
      extend ActiveSupport::Concern
      include Enjoy::Model
      include Enableable
      include ManualSlug
      include Enjoy.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, class_name: "Enjoy::Page"
        alias_method :items, :pages
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enjoy_cms-0.2.0.2 lib/enjoy/admin/menu.rb
enjoy_cms-0.2.0.1.beta lib/enjoy/admin/menu.rb
enjoy_cms-0.2.0.beta lib/enjoy/admin/menu.rb
enjoy_cms-0.1.0.beta1 lib/enjoy/admin/menu.rb