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

Merge pull request #667 from noesya/fix/includes-attachments-website-deps

N+1 in website.dependencies (pages + posts)
parents c9397f14 3dafd3d1
No related merge requests found
......@@ -82,8 +82,8 @@ class Communication::Website < ApplicationRecord
def git_dependencies(website)
dependencies = [self, config_default_languages, config_default_permalinks, config_development_config, config_production_config] + menus
dependencies += pages + pages.map(&:active_storage_blobs).flatten
dependencies += posts + posts.map(&:active_storage_blobs).flatten
dependencies += pages + pages.includes(parent: { featured_image_attachment: :blob }, featured_image_attachment: :blob).map(&:active_storage_blobs).flatten
dependencies += posts + posts.includes(featured_image_attachment: :blob).map(&:active_storage_blobs).flatten
dependencies += people_with_facets + people.map(&:active_storage_blobs).flatten
dependencies += organizations_in_blocks + organizations_in_blocks.map(&:active_storage_blobs).flatten
dependencies += categories
......
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