NumericalityValidator allow_nil
option doesn't work anymore for params coming from a controller
#40750
Labels
Milestone
numericality
validation helper behaviour on attributes of an ActiveRecord object created usingActionController::Parameters
has changed in Rails 6.1.0.rc2. It could be related to this refactoringSteps to reproduce
Expected behavior
allow_nil
option should allow to skip numericality validation for emptyActionController::Parameters
fields. Having to switch toallow_blank
option would be a breaking change.Actual behavior
numericality
validation fails with empty fields even ifallow_nil
option is specified.System configuration
Rails version: 6.1.0.rc2
Ruby version: 2.7.2
The text was updated successfully, but these errors were encountered: