diff options
| -rw-r--r-- | app/views/api/v1/routes/short_description.rabl | 7 | ||||
| -rw-r--r-- | app/views/api/v1/stop_areas/short_description.rabl | 4 | ||||
| -rw-r--r-- | app/views/journey_patterns/show.rabl | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/app/views/api/v1/routes/short_description.rabl b/app/views/api/v1/routes/short_description.rabl index ae149167d..900096ac5 100644 --- a/app/views/api/v1/routes/short_description.rabl +++ b/app/views/api/v1/routes/short_description.rabl @@ -5,3 +5,10 @@ extends "api/v1/trident_objects/short_description" attributes attr, :unless => lambda { |m| m.send( attr).nil?} end +child :stop_points => :stop_points do |stop_points| + node do |stop_point| + partial("api/v1/stop_areas/short_description", :object => stop_point.stop_area).merge(position: stop_point.position) + end +end + + diff --git a/app/views/api/v1/stop_areas/short_description.rabl b/app/views/api/v1/stop_areas/short_description.rabl index 73627c5a1..7b6a72491 100644 --- a/app/views/api/v1/stop_areas/short_description.rabl +++ b/app/views/api/v1/stop_areas/short_description.rabl @@ -1,10 +1,10 @@ object @stop_area -extends "api/v1/trident_objects/short_description" +extends "api/v1/trident_objects/short_description" [ :name, :area_type, :longitude, :latitude, :long_lat_type].each do |attr| attributes attr, :unless => lambda { |m| m.send( attr).nil?} end node(:parent_object_id) do |stop_area| - stop_area.parent.objectid + stop_area.parent.objectid end unless root_object.parent.nil? diff --git a/app/views/journey_patterns/show.rabl b/app/views/journey_patterns/show.rabl index 882660360..b1eaf2376 100644 --- a/app/views/journey_patterns/show.rabl +++ b/app/views/journey_patterns/show.rabl @@ -15,7 +15,6 @@ end unless root_object.vehicle_journeys.empty? child :stop_points => :stop_area_short_descriptions do |stop_points| node do |stop_point| - partial("api/v1/stop_areas/short_description", :object => stop_point.stop_area) - end -end unless root_object.stop_points.empty? - + partial("api/v1/stop_areas/short_description", :object => stop_point.stop_area) + end +end unless root_object.stop_points.empty? |
