diff --git a/app/models/communication/website/permalink.rb b/app/models/communication/website/permalink.rb index 1fce8b0feb7a55e8af8cc7e702af966e35d98c56..a9ddd9a1fd30b5faaccd721b21346561336c02f6 100644 --- a/app/models/communication/website/permalink.rb +++ b/app/models/communication/website/permalink.rb @@ -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 diff --git a/app/models/communication/website/permalink/category.rb b/app/models/communication/website/permalink/category.rb index 7576a37b398417cef81396440e5faaf2a1bd67db..8e63df80b05edc0edcacde35a3408914e08df1a1 100644 --- a/app/models/communication/website/permalink/category.rb +++ b/app/models/communication/website/permalink/category.rb @@ -13,6 +13,10 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm protected + def published? + true + end + def substitutions { slug: about.path diff --git a/app/models/communication/website/permalink/page.rb b/app/models/communication/website/permalink/page.rb index 0dde50989293e29f63ee6269c0ecc4dbf2c0f63b..d89b685954e0241d3a1ea96716929bac23962b2c 100644 --- a/app/models/communication/website/permalink/page.rb +++ b/app/models/communication/website/permalink/page.rb @@ -1,7 +1,4 @@ class Communication::Website::Permalink::Page < Communication::Website::Permalink - def self.required_in_config?(website) - false - end protected