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

fix #473

parent b1b97439
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,7 @@ class Communication::Website::Post < ApplicationRecord
dependencies += categories
dependencies += active_storage_blobs
dependencies += git_block_dependencies
dependencies += university.communication_blocks.where(template_kind: :posts).includes(:about).map(&:about).uniq
if author.present?
dependencies += [author, author.author]
dependencies += author.active_storage_blobs
......
......@@ -28,7 +28,10 @@ module Communication::Website::WithDependencies
def blocks
@blocks ||= begin
blocks = Communication::Block.where(about_type: 'Communication::Website::Page', about_id: pages)
blocks = blocks.or(Communication::Block.where(about_type: 'Communication::Website::Post', about_id: posts))
blocks = blocks.or(Communication::Block.where(about_type: 'Education::Program', about_id: education_programs)) if has_education_programs?
blocks = blocks.or(Communication::Block.where(about_type: 'Education::Diploma', about_id: education_diplomas)) if has_education_diplomas?
# TODO: Blocks from People & Organizations ?
blocks
end
end
......@@ -38,7 +41,7 @@ module Communication::Website::WithDependencies
end
def education_diplomas
has_education_diplomas? ? about.diplomas : Education::Program.none
has_education_diplomas? ? about.diplomas : Education::Diploma.none
end
def education_programs
......@@ -170,10 +173,6 @@ module Communication::Website::WithDependencies
about && about.has_education_programs?
end
def has_education_diplomas?
about && about.has_education_diplomas?
end
def has_research_papers?
about && about.has_research_papers?
end
......
......@@ -60,7 +60,7 @@ class Education::Diploma < ApplicationRecord
end
def git_path(website)
"content/diplomas/#{slug}/_index.html"
"content/diplomas/#{slug}/_index.html" if for_website?(website)
end
def git_dependencies(website)
......
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