Updated to be a bit more flexible with activesupport versions.