mongoid/mongoid — Issue #1757: Date returned as datetime in json
Author: iabdulin
Created: 2012-02-24 03:38:50+00:00
State: open

mongoid (2.4.5)

I have `field :date, :type => Date` in my model.

>> transaction.date.class
Date < Object
>> transaction.date
Sat, 21 May 2011
>> transaction.date.to_json
"\"2011-05-21\""

but

>> transaction.to_json
......"date\":\"2011-05-21T00:00:00Z\"....

in addition:
>> transaction[:date].class
Time < Object
>> transaction[:date]
2011-05-21 00:00:00 UTC

Why??? And how to change it?