Skip to content
Snippets Groups Projects
Unverified Commit b8752167 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

cc

parent 1de5a567
No related branches found
No related tags found
No related merge requests found
......@@ -88,19 +88,7 @@ class Communication::Website::Page < ApplicationRecord
siblings +
git_block_dependencies
dependencies += [parent] if has_parent?
dependencies += [website.config_permalinks] if is_special_page?
dependencies += [
website.categories,
website.authors.map(&:author),
website.posts
].flatten if kind_communication_posts?
['education_programs', 'education_diplomas', 'research_papers', 'organizations'].each do |kind|
dependencies += website.public_send(kind) if public_send("kind_#{kind}?")
end
dependencies += website.people_with_facets if kind_persons?
[:administrator, :author, :researcher, :teacher].each do |kind|
dependencies += website.public_send(kind.to_s.pluralize).map(&kind) if public_send("kind_#{kind.to_s.pluralize}?")
end
dependencies += special_page_git_dependencies(website) if is_special_page?
dependencies.flatten
end
......
......@@ -50,6 +50,23 @@ module Communication::Website::Page::WithKind
is_special_page? && SPECIAL_PAGES_WITH_GIT_SPECIAL_PATH.include?(kind)
end
def special_page_git_dependencies(website)
dependencies = [website.config_permalinks]
dependencies += [
website.categories,
website.authors.map(&:author),
website.posts
].flatten if kind_communication_posts?
['education_programs', 'education_diplomas', 'research_papers', 'organizations'].each do |kind|
dependencies += website.public_send(kind) if public_send("kind_#{kind}?")
end
dependencies += website.people_with_facets if kind_persons?
[:administrator, :author, :researcher, :teacher].each do |kind|
dependencies += website.public_send(kind.to_s.pluralize).map(&kind) if public_send("kind_#{kind.to_s.pluralize}?")
end
dependencies
end
end
private
......
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