diff options
| author | Teddy Wing | 2017-05-23 15:34:19 +0200 |
|---|---|---|
| committer | Robert | 2017-05-29 08:49:52 +0200 |
| commit | 100a89a8c11b8e14869da18c32134ac89b2fb0ef (patch) | |
| tree | 6ace531e7fa6681989d6c64c0ee54351385b28b0 /app | |
| parent | 95ebdc82c85acdf7cae208294a750e40e9e418c2 (diff) | |
| download | chouette-core-100a89a8c11b8e14869da18c32134ac89b2fb0ef.tar.bz2 | |
Rename `VehicleJourneyAtStopsAreInIncreasingOrderValidator`
Add `Time` to the validator's name because "increasing order" doesn't
seem specific enough. Order could be based on anything, like ID. We're
specifically validating the times of the at-stops.
Refs #870
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/chouette/vehicle_journey.rb | 2 | ||||
| -rw-r--r-- | app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb (renamed from app/models/chouette/vehicle_journey_at_stops_are_in_increasing_order_validator.rb) | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb index 20213213f..72d554e96 100644 --- a/app/models/chouette/vehicle_journey.rb +++ b/app/models/chouette/vehicle_journey.rb @@ -29,7 +29,7 @@ module Chouette has_many :stop_points, -> { order("stop_points.position") }, :through => :vehicle_journey_at_stops validates :vehicle_journey_at_stops, - vehicle_journey_at_stops_are_in_increasing_order: true + vehicle_journey_at_stops_are_in_increasing_time_order: true validates_presence_of :number before_validation :set_default_values diff --git a/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_order_validator.rb b/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb index ab454725a..9a13ae103 100644 --- a/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_order_validator.rb +++ b/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb @@ -1,6 +1,5 @@ module Chouette - # TODO: Rename to IncreasingTimeOrder - class VehicleJourneyAtStopsAreInIncreasingOrderValidator < + class VehicleJourneyAtStopsAreInIncreasingTimeOrderValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) increasing_times(record) |
