Make it work with Rails 4