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:
parent
2a60a7bd79
commit
fe1202d626
@ -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' " \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user