diff options
| author | cedricnjanga | 2018-01-04 10:40:26 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-01-04 10:40:49 +0100 |
| commit | 28d3edbe08b2e8ff55b1f586b0652086f3beb18c (patch) | |
| tree | 9e53a774bc330fcccd71104af09053728991a5b1 /app/models/generic_attribute_control | |
| parent | afd3b615aa880145aade35780679bb744df21a47 (diff) | |
| download | chouette-core-28d3edbe08b2e8ff55b1f586b0652086f3beb18c.tar.bz2 | |
Refs ##5461 Add validation on some Compliance Controls to avoid negative values on dynamic attributes
Diffstat (limited to 'app/models/generic_attribute_control')
| -rw-r--r-- | app/models/generic_attribute_control/min_max.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/generic_attribute_control/min_max.rb b/app/models/generic_attribute_control/min_max.rb index 1c429b9a4..18873b683 100644 --- a/app/models/generic_attribute_control/min_max.rb +++ b/app/models/generic_attribute_control/min_max.rb @@ -2,8 +2,8 @@ module GenericAttributeControl class MinMax < ComplianceControl store_accessor :control_attributes, :minimum, :maximum, :target - validates :minimum, numericality: true, allow_nil: true - validates :maximum, numericality: true, allow_nil: true + validates_numericality_of :minimum, allow_nil: true, greater_than_or_equal_to: 0 + validates_numericality_of :maximum, allow_nil: true, greater_than_or_equal_to: 0 validates :target, presence: true include MinMaxValuesValidation |
