aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-03-23 11:04:10 +0100
committerXinhui2017-03-23 11:04:16 +0100
commit73e5633307b978d4978743e39aa132d8a5442be4 (patch)
tree300f335f7c8b875e0deed3aeaaffab5c290c81f6
parentfd6009cbe541549682a57fa1b08704071d843207 (diff)
downloadchouette-core-73e5633307b978d4978743e39aa132d8a5442be4.tar.bz2
Fix route#edit stop_point must be ordered by position
Refs #2830
-rw-r--r--app/helpers/routes_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb
index d5d36ffa3..2f52f78f5 100644
--- a/app/helpers/routes_helper.rb
+++ b/app/helpers/routes_helper.rb
@@ -14,7 +14,7 @@ module RoutesHelper
end
def route_json_for_edit(route)
- route.stop_points.includes(:stop_area).map do |stop_point|
+ route.stop_points.includes(:stop_area).order(:position).map do |stop_point|
stop_area_attributes = stop_point.stop_area.attributes.slice("name","city_name", "zip_code", "registration_number", "longitude", "latitude", "area_type")
stop_area_attributes["short_name"] = truncate(stop_area_attributes["name"], :length => 30) || ""
stop_point_attributes = stop_point.attributes.slice("for_boarding","for_alighting")