made compatible with rails 4 and spree 2.3.3