make compatible with rails < 2.3