Fixed incompatibility with mongoid4

As discussed here: https://github.com/michaeldv/awesome_print/issues/133#issuecomment-36378132