apply fixes for mongoid 4 from https://github.com/rafaelgaspar/carrierwave-mongoid