Backporting #226 to 3.0 stable

Hello. I have similar problem (https://github.com/mongoid/mongoid/issues/2226).

Any chance to get this backported to 3.0 and release new version?

Thanks, Josef