Backwards compatible with rails 3