Module: Navable

Defined in:
app/models/navable.rb

Overview

This module provides the is_navable method for ActiveRecord::Base. Calling this method marks the model (User, Page, …) as navable, i.e. has menu, breadcrumbs, etc.

The inclusion in ActiveRecord::Base is done in config/initializers/active_record_navable_extension.rb.

Defined Under Namespace

Modules: InstanceMethodsForNavables

Instance Method Summary collapse

Instance Method Details

#is_navableObject



11
12
13
14
15
# File 'app/models/navable.rb', line 11

def is_navable
  has_one                :nav_node, as: :navable, dependent: :destroy, autosave: true
  
  include InstanceMethodsForNavables
end