dev_hjq v20151231_03
cxt 10 years ago
commit 7f751cfc63

@ -229,7 +229,11 @@ class AttachmentsController < ApplicationController
@attachment.container.init_journal(User.current)
end
if @attachment.container
@attachment.container.attachments.delete(@attachment)
if @attachment.container_type == "Issue"
@attachment.destroy
else
@attachment.container.attachments.delete(@attachment)
end
else
@attachment.destroy
end
@ -281,7 +285,7 @@ class AttachmentsController < ApplicationController
format.js
end
end
def delete_homework
@bid = @attachment.container.bid
# Make sure association callbacks are called
@ -344,13 +348,13 @@ class AttachmentsController < ApplicationController
end
respond_to do |format|
format.js
format.js
end
rescue NoMethodError
@save_flag = false
@save_message = [] << l(:error_attachment_empty)
respond_to do |format|
format.js
format.js
end
end

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save