diff options
| author | Teddy Wing | 2017-05-24 12:22:21 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-05-26 13:20:56 +0200 |
| commit | e6da3ada61206ec0778fb1139bc61073cf404c7e (patch) | |
| tree | 22088f790829896074d30c81fe5d4550a320cfb7 /app | |
| parent | 3564ad224a4f1e3a409e44a31950184e75920f2e (diff) | |
| download | chouette-core-e6da3ada61206ec0778fb1139bc61073cf404c7e.tar.bz2 | |
IncreasingTimeOrderValidator: Rename `#increasing_times_validate` method
I didn't like the name of this method because it wasn't super clear what
its intent was. Rename it to something that describes it better.
Refs #870
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb b/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb index 8e921b494..95f0cdc3e 100644 --- a/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb +++ b/app/models/chouette/vehicle_journey_at_stops_are_in_increasing_time_order_validator.rb @@ -8,7 +8,10 @@ module Chouette .vehicle_journey_at_stops .select { |vjas| vjas.departure_time && vjas.arrival_time } .each do |vjas| - unless self.class.increasing_times_validate(vjas, previous_at_stop) + unless self.class.validate_at_stop_times_must_increase( + vjas, + previous_at_stop + ) vehicle_journey.errors.add( :vehicle_journey_at_stops, 'time gap overflow' @@ -19,7 +22,7 @@ module Chouette end end - def self.increasing_times_validate(at_stop, previous_at_stop) + def self.validate_at_stop_times_must_increase(at_stop, previous_at_stop) valid = true return valid unless previous_at_stop |
