Add support for activesupport > 3

Compatibility with Rails 4