Skip to content

Commit fe1202d

Browse files
committed
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
1 parent 2a60a7b commit fe1202d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/models/attachment.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Attachment < ActiveRecord::Base
4848
:scope =>
4949
proc do
5050
select("#{Attachment.table_name}.*").
51+
where(container_type: ['Version', 'Project']).
5152
joins(
5253
"LEFT JOIN #{Version.table_name} " \
5354
"ON #{Attachment.table_name}.container_type='Version' " \

0 commit comments

Comments
 (0)