Add support for Rails 3.1+