Skip to content
Snippets Groups Projects
Commit 68ab11bd authored by pabois's avatar pabois
Browse files

Merge branch 'feature/previous_links' of github.com:noesya/osuny into feature/previous_links

parents 2a6fcbbc b29f2212
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ class Communication::Website::Permalink < ApplicationRecord
scope :not_current, -> { where(is_current: false) }
def self.config_in_website(website)
required_kinds_in_website.map { |permalink_class|
required_kinds_in_website(website).map { |permalink_class|
[permalink_class.static_config_key, permalink_class.pattern_in_website(website)]
}.to_h
end
......@@ -62,6 +62,11 @@ class Communication::Website::Permalink < ApplicationRecord
permalink = permalink_class.new(website: website, about: object)
end
# Can be overwritten
def self.required_in_config?(website)
false
end
def self.pattern_in_website(website)
raise NotImplementedError
end
......
......@@ -13,6 +13,10 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm
protected
def published?
true
end
def substitutions
{
slug: about.path
......
class Communication::Website::Permalink::Page < Communication::Website::Permalink
def self.required_in_config?(website)
false
end
protected
......
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