make compatible with rails ~> 3.0