aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-02-15 17:02:35 +0100
committerXinhui2017-02-15 17:02:35 +0100
commit9bdb5ef953b43138244b4215a342d4b607b8d463 (patch)
treeaff8ee0dc0a3354b4468823b310e89caf54a1aba
parent486562907aa7f2daaf12c5ec2a7fe118c8b2e2f8 (diff)
downloadchouette-core-9bdb5ef953b43138244b4215a342d4b607b8d463.tar.bz2
Refactoring vehicle_journey_at_stops arrival_time - departure_time format
-rw-r--r--app/views/vehicle_journeys/show.rabl8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl
index 7ea226916..58c82ea45 100644
--- a/app/views/vehicle_journeys/show.rabl
+++ b/app/views/vehicle_journeys/show.rabl
@@ -39,8 +39,12 @@ child :vehicle_journey_at_stops, :object_root => false do |vehicle_stops|
end
[:arrival_time, :departure_time].map do |att|
- node("#{att}_hour".to_sym) { vehicle_stop.send(att).strftime('%H') }
- node("#{att}_minute".to_sym) { vehicle_stop.send(att).strftime('%M') }
+ node(att) do |vs|
+ {
+ hour: vs.send(att).strftime('%H'),
+ minute: vs.send(att).strftime('%M'),
+ }
+ end
end
end
end