diff options
| author | cedricnjanga | 2018-01-02 17:28:17 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-01-04 10:40:49 +0100 |
| commit | 102db8a01b2a0fa9f77650c231f208d2875cc473 (patch) | |
| tree | 0e0feeef9fe567b92c2c164393a88ec0377364e6 | |
| parent | a5e99f3f49c055fba455a4e94b5c5ed8fb584fd1 (diff) | |
| download | chouette-core-102db8a01b2a0fa9f77650c231f208d2875cc473.tar.bz2 | |
#5451 Add validation only accept positive values for the dynamic attributes
| -rw-r--r-- | app/models/vehicle_journey_control/speed.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/vehicle_journey_control/speed.rb b/app/models/vehicle_journey_control/speed.rb index 14fad9139..e5e331b50 100644 --- a/app/models/vehicle_journey_control/speed.rb +++ b/app/models/vehicle_journey_control/speed.rb @@ -2,8 +2,8 @@ module VehicleJourneyControl class Speed < ComplianceControl store_accessor :control_attributes, :minimum, :maximum - 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 include MinMaxValuesValidation def self.default_code; "3-VehicleJourney-2" end |
