Sha256: a68729d2f85b5519f52838f8e7300517ab39f533db1e78e364a3942f319911e3
Contents?: true
Size: 230 Bytes
Versions: 1
Compression:
Stored size: 230 Bytes
Contents
class FloatFormatValidator < ActiveModel::EachValidator # :nodoc: def validate_each(record, attribute, value) Float(value) rescue ArgumentError, TypeError record.errors.add(attribute, 'is not a Float format') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
csv_row_model-1.0.0.beta2 | lib/csv_row_model/validators/float_format_validator.rb |