diff --git a/decidim-assemblies/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb b/decidim-assemblies/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb index 8bdc1bf6cb7b5..13b746f733b51 100644 --- a/decidim-assemblies/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb +++ b/decidim-assemblies/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb @@ -22,6 +22,7 @@ def highlighted_assemblies @highlighted_assemblies ||= OrganizationPrioritizedAssemblies .new(current_organization, current_user) .query + .with_attached_hero_image .includes([:organization]) .limit(max_results) end diff --git a/decidim-conferences/app/queries/decidim/conferences/organization_prioritized_conferences.rb b/decidim-conferences/app/queries/decidim/conferences/organization_prioritized_conferences.rb index ab542872098ef..45ce250eb2a12 100644 --- a/decidim-conferences/app/queries/decidim/conferences/organization_prioritized_conferences.rb +++ b/decidim-conferences/app/queries/decidim/conferences/organization_prioritized_conferences.rb @@ -14,7 +14,7 @@ def query Decidim::Query.merge( OrganizationPublishedConferences.new(@organization, @user), PrioritizedConferences.new - ).query + ).query.with_attached_hero_image end end end diff --git a/decidim-core/lib/decidim/has_attachments.rb b/decidim-core/lib/decidim/has_attachments.rb index 4034705839892..0e3f6521dab80 100644 --- a/decidim-core/lib/decidim/has_attachments.rb +++ b/decidim-core/lib/decidim/has_attachments.rb @@ -26,14 +26,14 @@ def photo # # Returns an Array def photos - @photos ||= attachments.order(:weight).select(&:photo?) + @photos ||= attachments.with_attached_file.order(:weight).select(&:photo?) end # All the attachments that are documents for this model. # # Returns an Array def documents - @documents ||= attachments.order(:weight).includes(:attachment_collection).select(&:document?) + @documents ||= attachments.with_attached_file.order(:weight).includes(:attachment_collection).select(&:document?) end # All the attachments that are documents for this model that has a collection. diff --git a/decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb b/decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb index 955231abf31bb..3ac8bb65881b5 100644 --- a/decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb +++ b/decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb @@ -14,7 +14,7 @@ def show def upcoming_meetings @upcoming_meetings ||= Decidim::Meetings::Meeting - .includes(component: :participatory_space) + .includes(:author, component: :participatory_space) .where(component: meeting_components) .visible_for(current_user) .published diff --git a/decidim-participatory_processes/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb b/decidim-participatory_processes/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb index e27352a98f7b9..6d9053e11269e 100644 --- a/decidim-participatory_processes/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb +++ b/decidim-participatory_processes/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb @@ -51,7 +51,7 @@ def highlighted_processes OrganizationPublishedParticipatoryProcesses.new(current_organization, current_user) | HighlightedParticipatoryProcesses.new | FilteredParticipatoryProcesses.new("active") - ).query.includes([:organization]).limit(highlighted_processes_max_results) + ).query.with_attached_hero_image.includes([:organization, :hero_image_attachment]).limit(highlighted_processes_max_results) end end