Monday, August 2, 2010

NoMethodError: undefined method sanitize_for_mass_assignment

once upon a time i started getting a strange error:

NoMethodError: undefined method `sanitize_for_mass_assignment'


after poking and prodding it turned out that after running bundle install, bundler grabbed the latest version of the state_machine gem, namely 0.9.4, which makes the call to sanitize_for_mass_assignment, which wasn't found. i likely have some other dependencies missing. however, to get back to my regularly scheduled coding, i just modified my Gemfile to use a previous version of state_machine:

gem 'state_machine', '0.9.3'


now all is good and my rake tests are passing again.

2 comments: