mongoid/mongoid — pull request #1698 by piotrj (2012-02-09 18:27:15+00:00)
Title: Return 0 if Integer field can't be serialized

ActiveRecord defaults to 0 when you try to assign non-numeric string to an integer field.
Mongoid saves the original string.

I am not sure whether what was the reasoning behind that decision and maybe it makes sense, but maybe it would be nice to make it consistent with ActiveRecord.

Moreover, when you have integer field you probably assume that this is integer and you do not check whether it actually is. Therefore, you can get exceptions in some strange places in your app when in some place you do `field_that_is_supposed_to_be_integer_but_is_not + 45`.

What you guys think? Makes sense, does not make sense ?