Make it work on Rails 4 and beyond