Notes on upgrading from Rails 4.0 to 4.1

This upgrade was fairly easy. The thing that will potentially give you more work are tests around ajax requests.

Here are the few detailed notes:

ActiveModels now includes a none scope by default. So if you have some none scope defined, just remove their definitions.

The state machine gem has not been updated for Rails 4.1 yet. Rails 4.1 made private the around_validation method in ActiveModels. Since state machine uses this method to inject its own validations, you need an extension for it. I’ve created a file named config/initializers/state_machine.rb and added the following code:module StateMachine::Integrations::ActiveModel; public :around_validation; end

CFRS is also possible in AJAX request. Because of this AJAX requests are checked against it as well as of Rails 4.1. Therefore, in your tests, get :whatever, :format => ‘js’ has to become xhr :get, :whatever, :format => :js