|
|
|
@ -90,8 +90,8 @@ class Attachment < ActiveRecord::Base
|
|
|
|
|
@@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails")
|
|
|
|
|
|
|
|
|
|
before_save :files_to_final_location
|
|
|
|
|
after_save :act_as_course_activity
|
|
|
|
|
after_create :office_conver, :be_user_score,:act_as_forge_activity,:create_attachment_ealasticsearch_index
|
|
|
|
|
after_save :act_as_course_activity,:act_as_forge_activity
|
|
|
|
|
after_create :office_conver, :be_user_score,:create_attachment_ealasticsearch_index
|
|
|
|
|
after_update :office_conver, :be_user_score,:update_attachment_ealasticsearch_index
|
|
|
|
|
after_destroy :delete_from_disk,:down_user_score,:delete_attachment_ealasticsearch_index, :decrease_attchments_count, :down_course_score
|
|
|
|
|
|
|
|
|
@ -606,7 +606,7 @@ class Attachment < ActiveRecord::Base
|
|
|
|
|
# Author lizanle
|
|
|
|
|
# Description 上传该项目的文档资料也要保存一份在公共表中
|
|
|
|
|
def act_as_forge_activity
|
|
|
|
|
if self.container_type == 'Project'
|
|
|
|
|
if self.container_type == 'Project' && self.forge_acts.empty?
|
|
|
|
|
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
|
|
|
|
:project_id => self.container_id)
|
|
|
|
|
end
|
|
|
|
|