aboutsummaryrefslogtreecommitdiffstats
path: root/lib/model_attribute.rb
diff options
context:
space:
mode:
authorTeddy Wing2018-03-15 17:09:49 +0100
committerTeddy Wing2018-03-15 17:44:22 +0100
commit7fb536325c19e837d10707e9adfc0d8bce5a3976 (patch)
tree1f9595434dd7b979c6e1f5bc659c177d1c1b1d15 /lib/model_attribute.rb
parentfa0fdbe92d441e1a226a56c792c014a032fd46e9 (diff)
downloadchouette-core-7fb536325c19e837d10707e9adfc0d8bce5a3976.tar.bz2
Add `RouteWayCostJSONSerializer`
This serialiser will take `Route#costs` and convert the distance and time fields from meters to kilometres and seconds to minutes respectively. We need this because the frontend uses kilometre and minute units while the TomTom API gives us the others (and we store the data we get from TomTom without treatment). Unfortunately, due to the way that Rabl works, this doesn't quite work just yet. The serializer returns a string, and Rabl just puts this string into the JSON output instead of a real JSON hash. Looks like I'm going to have to convert my serializer into a generic converter. Refs #6203
Diffstat (limited to 'lib/model_attribute.rb')
0 files changed, 0 insertions, 0 deletions