Class: NavigationGroup
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- NavigationGroup
- Includes:
- Checkable, RequiredUniqueName, RequiredUniqueSlug
- Defined in:
- app/models/navigation_group.rb
Overview
Navigation group
Attributes:
created_at [DateTime]
dynamic_pages_count [integer]
name [string]
slug [string]
updated_at [DateTime]
Constant Summary collapse
- NAME_LIMIT =
100
- SLUG_LIMIT =
100
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.entity_parameters ⇒ Object
26 27 28 |
# File 'app/models/navigation_group.rb', line 26 def self.entity_parameters %i[name slug] end |
Instance Method Details
#add_dynamic_page(entity) ⇒ Object
35 36 37 |
# File 'app/models/navigation_group.rb', line 35 def add_dynamic_page(entity) .create(dynamic_page: entity) end |
#remove_dynamic_page(entity) ⇒ Object
40 41 42 |
# File 'app/models/navigation_group.rb', line 40 def remove_dynamic_page(entity) .where(dynamic_page: entity).destroy_all end |
#text_for_link ⇒ Object
30 31 32 |
# File 'app/models/navigation_group.rb', line 30 def text_for_link name end |