From fe1202d6266fb578c61d690289ad283ac08a6560 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 14 May 2022 07:38:36 +0000 Subject: [PATCH] Attachment activity provider SQL optimization (#37057). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21573 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/attachment.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index bbc9a4660..7c60c7164 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -48,6 +48,7 @@ class Attachment < ActiveRecord::Base :scope => proc do select("#{Attachment.table_name}.*"). + where(container_type: ['Version', 'Project']). joins( "LEFT JOIN #{Version.table_name} " \ "ON #{Attachment.table_name}.container_type='Version' " \ -- 2.39.5