Make it work in Rails 4 and beyond