Skip to content
Snippets Groups Projects
Unverified Commit 685ccdb4 authored by Pierre-André Boissinot's avatar Pierre-André Boissinot Committed by GitHub
Browse files

Merge pull request #617 from noesya/posts_categories_referenced_with_ancestors

Ajout des ancêtres dans les chemins des categories lors de de la génération du static d'un post
parents 295a00de fd020d7e
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,10 @@ class Communication::Website::Category < ApplicationRecord
self.class.unscoped.where(parent: parent, university: university, website: website).where.not(id: id)
end
def slug_with_ancestors_slugs
(ancestors.map(&:slug) << slug).join('/')
end
protected
def last_ordered_element
......
......@@ -12,7 +12,7 @@ authors:
<% if @about.categories.any? %>
categories:
<% @about.categories.each do |category| %>
- "<%= category.slug %>"
- "<%= category.slug_with_ancestors_slugs %>"
<% end %>
<% end %>
<%= render 'admin/communication/unsplash/static' %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment