Backwards compatibility with rails 3