InvalidParameterError does not contain "param" when coercion validation fails
Closed this issue ยท 3 comments
crevete commented
Basic Info
- rails_param Version: 1.3.0
- Ruby Version: 3.2.2
- Rails Version: 7.0.6
Issue description
param! :foo, Float
With value aa
, this raises InvalidParameterError
with the message 'aa' is not a valid Float
. However, InvalidParameterError#param
returns nil
. The parameter name is lost here.
Quick fix : in RailsParam::ParamEvaluator#param!
, when calling #coerce
, pass the parameter_name
as argument so that it could be set when raising InvalidParameterError
.
Thanks
iMacTia commented
Already done ๐
https://rubygems.org/gems/rails_param/versions/1.3.1
crevete commented
Awesome ๐