Skip to content

Commit

Permalink
Include parameters class name in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Sep 9, 2016
1 parent 6e932d2 commit 60023aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/active_interaction/base.rb
Expand Up @@ -241,10 +241,11 @@ def run_validations!
def normalize_inputs!(inputs)
return inputs if inputs.is_a?(Hash)

klass = 'ActionController::Parameters'.safe_constantize
parameters = 'ActionController::Parameters'
klass = parameters.safe_constantize
return inputs.to_unsafe_h if klass && inputs.is_a?(klass)

raise ArgumentError, 'inputs must be a hash'
raise ArgumentError, "inputs must be a hash or #{parameters}"
end

# @param inputs [Hash{Symbol => Object}]
Expand Down

0 comments on commit 60023aa

Please sign in to comment.