mongoid/mongoid — pull request #1911 by Empact (2012-04-12 23:46:01+00:00)
Title: Extract Mongoid::Base from Documents so that we get InvalidFieldErrors when we try to create fields conflicting with those methods

In the mongoid-slug specs there's an class with a field named :identity. I noticed there was no error when the field was defined and the field was silently overwritten by the Mongoid::Document#identity method.

I extracted the Document methods into a new module: Mongoid::Base and added it to the Components field validity checking.