Compatibility with Rails 4