Make compatible with rails ~> 4.0