I'm currently in the process of switching from ActiveRecord's as_json
to RABL for API generation.
as_json
has been rendering timestamps in my models as strings of the format 2012-09-16T22:14:11+00:00
. However, when I switched to RABL timestamps started rendering as epoch numbers like 1347926218.084763000
(note these dates are from two different objects and are not supposed to be equal). Is there a way to force the string format?
My .rabl template is pretty simple:
object @person
attributes :id, :created_on, :name
and I get:
{"id":3,"created_on":1347926218.084763000,"name":"fred"}