mongoid/mongoid — pull request #2295 by i0rek (2012-08-16 12:05:23+00:00)
Title: Provide #to_hash on mongoid errors.

Fixes #2287. It doesn't provide an explicit #to_json method,
but #to_hash which then can be used to get json output.
I decided to provide #to_hash because its multi purpose, eg it
can be used for #to_yaml, ...