Skip to content

Commit

Permalink
Use deep_symbolize_keys to better align close and open params
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo committed Aug 27, 2019
1 parent 49ad8b7 commit 10c176b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/controllers/versions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@ def open_params
end

def close_params
symbolized_hash = params.permit(
params.permit(
:description,
:significance,
:start_accession,
:version_num
).to_h.symbolize_keys
# Downstream code expects the significance value to be a symbol
symbolized_hash[:significance] = symbolized_hash[:significance].to_sym if symbolized_hash.key?(:significance)
symbolized_hash
).to_h.deep_symbolize_keys
end
end

0 comments on commit 10c176b

Please sign in to comment.