Make compatible with rails 3.