SchemaPlus / schema_validations

Automatically creates validations basing on the database schema.
Other
174 stars 34 forks source link

Fix the filtering of attributes validated with SchemaValidations::Validators::NotNilValidator #56

Open dark-panda opened 6 years ago

dark-panda commented 6 years ago

Sorry, but I wasn't able to get the specs running correctly on my setup, so I have not included updated specs in the patch.

This appears to be a special case where the name parameter of #_filter_validation is set to SchemaValidations::Validators::NotNilValidator and the actual name is found in the :attribute option in opts. Filtering-by-name using the only, except, etc. configurations see the wrong name value in these cases and will not be filtered correctly as a result.