aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-02-27 15:25:01 +0100
committerXinhui2017-02-27 15:25:01 +0100
commitcac66df21d2b17bad7ca9b77d1785971062e2d9a (patch)
treeb8ef72191c1aefa6fb848a5a0c860fdb5ff3242b
parentc189fae82a6421832e3052ef75c51e37d8afa7a6 (diff)
downloadchouette-core-cac66df21d2b17bad7ca9b77d1785971062e2d9a.tar.bz2
Refactoring vehicle_journey#index json format
-rw-r--r--app/views/vehicle_journeys/show.rabl24
1 files changed, 4 insertions, 20 deletions
diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl
index 91d552c4f..9caf13301 100644
--- a/app/views/vehicle_journeys/show.rabl
+++ b/app/views/vehicle_journeys/show.rabl
@@ -9,30 +9,14 @@ child(:journey_pattern) do |journey_pattern|
end
child(:time_tables, :object_root => false) do |time_tables|
- node do |tt|
- [:objectid, :comment].map do |att|
- node(att) { tt.send(att) }
- end
- node :calendar do |tt|
- {
- id: tt.calendar.id,
- name: tt.calendar.name,
- date_ranges: tt.calendar.date_ranges,
- dates: tt.calendar.dates,
- shared: tt.calendar.shared
- }
- end
+ attributes :objectid, :comment
+ child(:calendar) do
+ attributes :id, :name, :date_ranges, :dates, :shared
end
end
child :footnotes, :object_root => false do |footnotes|
- node do |footnote|
- {
- id: footnote.id,
- code: footnote.code,
- label: footnote.label
- }
- end
+ attributes :id, :code, :label
end
child :vehicle_journey_at_stops, :object_root => false do |vehicle_stops|