@ -39,12 +39,14 @@ class Attachment < ActiveRecord::Base
#课程资源文件
acts_as_activity_provider :type = > 'course_files' ,
:is_public = > 'attachments.is_public' ,
:permission = > :view_files ,
:author_key = > :author_id ,
:find_options = > { :select = > " #{ Attachment . table_name } .* " ,
:joins = > " LEFT JOIN #{ Course . table_name } ON ( #{ Attachment . table_name } .container_type='Course' AND #{ Attachment . table_name } .container_id = #{ Course . table_name } .id ) " }
acts_as_activity_provider :type = > 'files' ,
:is_public = > 'attachments.is_public' ,
:permission = > :view_files ,
:author_key = > :author_id ,
:find_options = > { :select = > " #{ Attachment . table_name } .* " ,
@ -52,6 +54,7 @@ class Attachment < ActiveRecord::Base
" LEFT JOIN #{ Project . table_name } ON #{ Version . table_name } .project_id = #{ Project . table_name } .id OR ( #{ Attachment . table_name } .container_type='Project' AND #{ Attachment . table_name } .container_id = #{ Project . table_name } .id ) " }
acts_as_activity_provider :type = > 'documents' ,
:is_public = > 'documents.is_public' ,
:permission = > :view_documents ,
:author_key = > :author_id ,
:find_options = > { :select = > " #{ Attachment . table_name } .* " ,