1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-02 15:31:49 +00:00

Attachment activity provider SQL optimization (#37057).

Patch by Jens Krämer.


git-svn-id: https://svn.redmine.org/redmine/trunk@21573 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2022-05-14 07:38:36 +00:00
parent 2a60a7bd79
commit fe1202d626

View File

@ -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' " \