Skip to content

Commit

Permalink
Remove shared usage of safe_params
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed May 26, 2021
1 parent 53e1b6f commit f4a8fbd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/controllers/datacite_dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4a8fbd

Please sign in to comment.