mongoid/mongoid — pull request #1717 by i0rek (2012-02-14 16:22:03+00:00)
Title: Try to find the correct class.

At the moment only two namespaces are considered to have the class: root and the namespace inverse_class_name is in. But there are possibly other modules in between which could define class and therefore we need to search them too.