Make compatible with mongoid 4