Make it work in Rails 4