Changes to upgrade to Rails 4