changes for rails4
more changes for rails4, mongoid4, spree2.2