-
-
Notifications
You must be signed in to change notification settings - Fork 190
Hash Validations
Tilo edited this page Feb 2, 2018
·
3 revisions
Hash Validations come in handy if you want to check that data for certain columns is present in a record (required fields).
Hash Validations do not throw an exception, but instead add an error to the @errors hash, using the numerical file_line_count of the current line in the CSV file as the key. Check the source code.
This checks if any of the required fields has a non-nil, non-blank, non-zero value in the given CSV row.
This checks if any of the required fields matches the given regular expression for the given CSV row.
You can define your own custom hash validations using Ruby Procs.
Here you can find the pre-defined hash validations