diff --git a/app/models/communication/website/page/with_kind.rb b/app/models/communication/website/page/with_kind.rb index c5f491dc759e87b87295d62678aeb04d1d1c6b69..a504be139e5ba52bca589079f034558a561aaeff 100644 --- a/app/models/communication/website/page/with_kind.rb +++ b/app/models/communication/website/page/with_kind.rb @@ -52,18 +52,23 @@ module Communication::Website::Page::WithKind 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}?") + case kind + when "communication_posts" + dependencies += [ + website.categories, + website.authors.map(&:author), + website.posts + ].flatten + when "education_programs", "education_diplomas", "research_papers", "organizations" + # dependencies += website.education_programs + dependencies += website.public_send(kind) + when "people" + dependencies += website.people_with_facets + when "administrators", "authors", "researchers", "teachers" + # dependencies += website.authors.map(&:author) + dependencies += website.public_send(kind).map(&kind.singularize.to_sym) end + dependencies end