附件问题

dev_daiao
daiao 5 years ago
parent 4c90d1486b
commit 69d5fb5227

@ -68,7 +68,7 @@ class AttachmentsController < ApplicationController
@attachment.author_id = current_user.id
@attachment.disk_directory = month_folder
@attachment.cloud_url = remote_path
@attachment.container_id = params[:container_id]
@attachment.container_id = conversion_container_id(params[:container_id], params[:container_type])
@attachment.container_type = params[:container_type]
@attachment.attachtype = params[:attachtype]
@attachment.save!
@ -215,4 +215,10 @@ class AttachmentsController < ApplicationController
end
end
end
def conversion_container_id id, type
if type == 'Shixun'
Shixun.find_by_identifier(id).id
end
end
end

Loading…
Cancel
Save