Module: PagesCore::PageModel::Pathable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Page
- Defined in:
- app/models/concerns/pages_core/page_model/pathable.rb
Instance Method Summary collapse
Instance Method Details
#ensure_path_segment ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/models/concerns/pages_core/page_model/pathable.rb', line 26 def ensure_path_segment return if deleted? || path_segment? || generated_path_segment.blank? segment = generated_path_segment segment = "#{segment}-#{id}" if path_collision?(segment) update(path_segment: segment) end |
#full_path ⇒ Object
18 19 20 |
# File 'app/models/concerns/pages_core/page_model/pathable.rb', line 18 def full_path generate_full_path end |
#full_path? ⇒ Boolean
22 23 24 |
# File 'app/models/concerns/pages_core/page_model/pathable.rb', line 22 def full_path? path_segment.present? && pathable? end |
#pathable? ⇒ Boolean
34 35 36 37 38 |
# File 'app/models/concerns/pages_core/page_model/pathable.rb', line 34 def pathable? return true unless parent parent.full_path? end |