Class: CsvValidator
Constant Summary
collapse
- DIMENSIONS =
%i[
columns rows
].freeze
FileSizeValidator::CHECKS
Instance Method Summary
collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/lite/validators/csv_validator.rb', line 11
def validate_each(record, attribute, value)
assert_valid_dimensions!
assert_valid_checks!
assign_attr_readers(record, attribute, csv_dimensions(value.path))
valid?
rescue CSV::MalformedCSVError
record.errors.add(attribute, *error_message)
end
|