Skip to content
Snippets Groups Projects
Commit 04d8170f authored by Arnaud Levy's avatar Arnaud Levy
Browse files

simpler

parent da92a09c
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,7 @@ class Communication::Website::Permalink < ApplicationRecord
scope :not_current, -> { where(is_current: false) }
def self.config_in_website(website)
MAPPING.values.select { |permalink_class|
permalink_class.required_for_website?(website)
}.map { |permalink_class|
config_required_in_website.map { |permalink_class|
[permalink_class.static_config_key, permalink_class.pattern_in_website(website)]
}.to_h
end
......@@ -79,6 +77,12 @@ class Communication::Website::Permalink < ApplicationRecord
protected
def self.config_required_in_website(website)
MAPPING.values.select { |permalink_class|
permalink_class.required_for_website?(website)
}
end
def published?
# Can be overwritten
true
......
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