diff --git a/app/models/attachment.rb b/app/models/attachment.rb index bbc9a4660..161d28caf 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' " \ @@ -66,6 +67,7 @@ class Attachment < ActiveRecord::Base :scope => proc do select("#{Attachment.table_name}.*"). + where(container_type: 'Document'). joins( "LEFT JOIN #{Document.table_name} " \ "ON #{Attachment.table_name}.container_type='Document' " \