mongodb/bson-ruby — pull request #16 by fbernier (2014-03-22 19:01:09+00:00)
Title: Fix Time encoding

Hi,

This is a resulting of a yak shave for the following issue:
https://github.com/mongoid/mongoid/pull/3563

The previous code was causing rounding errors. The result for us was when using Mongoid::Timestamps in embedded documents, the query sent to mongodb when deleting documents was a $pullAll with it's create_at and updated_at fields which were badly encoded. For every documents where the rounding error occurred, they were never deleted with a delete_all/destroy_all.

The Time I used in the updated spec is one causing this rounding error. You can test the old line bson encoding line with it to see the test actually fail.

This debug session has occurred in an @openhack event taking place in Quebec City. Hat tip to @jpbougie for identifying the issue and fixing it.