diff --git a/app/controllers/datacite_dois_controller.rb b/app/controllers/datacite_dois_controller.rb index b912f6abd..f61a89a4f 100644 --- a/app/controllers/datacite_dois_controller.rb +++ b/app/controllers/datacite_dois_controller.rb @@ -561,15 +561,14 @@ def update @doi.assign_attributes(safe_params.slice(:client_id)) else authorize! :update, @doi - params = safe_params - if params[:schema_version].blank? + if safe_params[:schema_version].blank? @doi.assign_attributes( - params.except(:doi, :client_id).merge( + safe_params.except(:doi, :client_id).merge( schema_version: @doi[:schema_version] || LAST_SCHEMA_VERSION, ), ) else - @doi.assign_attributes(params.except(:doi, :client_id)) + @doi.assign_attributes(safe_params.except(:doi, :client_id)) end end else