Added a metadata handler for mongoid documents.