aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/journey_pattern.rb
diff options
context:
space:
mode:
authorZog2018-02-01 10:34:40 +0100
committerZog2018-02-01 10:34:40 +0100
commitd114d549f7bc8a772803175dee9a665266d8ed04 (patch)
tree228fa0008b6938d4d7682896df1d9578abdce872 /app/models/chouette/journey_pattern.rb
parent90f54f0acfe65ff276a229239809ce0e9fddf0b0 (diff)
downloadchouette-core-d114d549f7bc8a772803175dee9a665266d8ed04.tar.bz2
Refs #5798 @3h; Show return journeys on the journeys' editor.
Diffstat (limited to 'app/models/chouette/journey_pattern.rb')
-rw-r--r--app/models/chouette/journey_pattern.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb
index 55faaf997..a81f4e9ce 100644
--- a/app/models/chouette/journey_pattern.rb
+++ b/app/models/chouette/journey_pattern.rb
@@ -160,12 +160,13 @@ module Chouette
def full_schedule?
full = true
- stop_points.inject(nil) do |start, finish|
+ stop_points.order(:position).inject(nil) do |start, finish|
next finish unless start.present?
costs = costs_between(start, finish)
full = false unless costs.present?
full = false unless costs[:distance] && costs[:distance] > 0
full = false unless costs[:time] && costs[:time] > 0
+ p "#{start.stop_area_id}-#{finish.stop_area_id}" unless full
finish
end
full