1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-03 23:53:23 +00:00

Don't check that param is a Hash.

git-svn-id: http://svn.redmine.org/redmine/trunk@16601 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-06-03 08:30:32 +00:00
parent 99a714e39b
commit 8e2983dd70

View File

@ -114,11 +114,9 @@ class AttachmentsController < ApplicationController
# Update all the attachments of a container
def update_all
if params[:attachments].is_a?(Hash)
if Attachment.update_attachments(@attachments, params[:attachments])
redirect_back_or_default home_path
return
end
if Attachment.update_attachments(@attachments, update_all_params)
redirect_back_or_default home_path
return
end
render :action => 'edit_all'
end
@ -225,4 +223,9 @@ class AttachmentsController < ApplicationController
'attachment'
end
end
# Returns attachments param for #update_all
def update_all_params
params.permit(:attachments => [:filename, :description]).require(:attachments)
end
end