aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/route.rb
diff options
context:
space:
mode:
authorAlban Peignier2018-04-16 09:28:20 +0200
committerAlban Peignier2018-04-16 09:36:59 +0200
commitc16f90bca5e3ffef46a67623f2c316a2fd79a18a (patch)
tree53328d7bf77de40b7618b6259eba5868bdfcc350 /app/models/chouette/route.rb
parent9e5577115003e84b501f4879ba4dcdac3167acb9 (diff)
downloadchouette-core-c16f90bca5e3ffef46a67623f2c316a2fd79a18a.tar.bz2
Improve Route stop_points position check. Use CHOUETTE_ROUTE_POSITION_CHECK env variable. Refs #6179
Diffstat (limited to 'app/models/chouette/route.rb')
-rw-r--r--app/models/chouette/route.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/chouette/route.rb b/app/models/chouette/route.rb
index 9c722851f..c5e909d7e 100644
--- a/app/models/chouette/route.rb
+++ b/app/models/chouette/route.rb
@@ -7,11 +7,12 @@ module Chouette
include ObjectidSupport
extend Enumerize
- if Rails.env.development?
+ if ENV["CHOUETTE_ROUTE_POSITION_CHECK"] == "true" || !Rails.env.production?
after_commit do
positions = stop_points.pluck(:position)
+ Rails.logger.debug "Check positions in Route #{id} : #{positions.inspect}"
if positions.size != positions.uniq.size
- raise "DUPLICATED stop_points positions: #{positions}"
+ raise "DUPLICATED stop_points positions in Route #{id} : #{positions.inspect}"
end
end
end