Maintain backwards compatibility with Rails <4.2