compatibility with rails 3