Class: Renalware::Patients::TemperatureValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Renalware::Patients::TemperatureValidator
- Includes:
- NumericRangeValidations, NumericScaleValidations
- Defined in:
- app/validators/renalware/patients/temperature_validator.rb
Constant Summary collapse
- MIN_VALUE =
28.0
- MAX_VALUE =
45.0
- MAX_DECIMAL_PLACES =
1
Instance Method Summary collapse
Methods included from NumericScaleValidations
#number_exceeds_scale?, #validate_numeric_scale
Methods included from NumericRangeValidations
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
12 13 14 15 16 17 |
# File 'app/validators/renalware/patients/temperature_validator.rb', line 12 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 |