Sha256: fba894a0e2cdf85cd213edeea86609748c2b5295366cdb5f1da9c18127cfd217
Contents?: true
Size: 512 Bytes
Versions: 35
Compression:
Stored size: 512 Bytes
Contents
module Renalware module Patients class WeightValidator < ActiveModel::EachValidator include NumericRangeValidations include NumericScaleValidations MIN_VALUE = 5.0 MAX_VALUE = 300.0 MAX_DECIMAL_PLACES = 1 def validate_each(record, attribute, value) return if value.blank? validate_number_is_in_range(record, attribute, value, MIN_VALUE, MAX_VALUE) validate_numeric_scale(record, attribute, value, MAX_DECIMAL_PLACES) end end end end
Version data entries
35 entries across 35 versions & 1 rubygems