Making the project (mostly) compatible with Rails 4