Created
September 5, 2011 16:42
-
-
Save juanghurtado/1195430 to your computer and use it in GitHub Desktop.
Rails 3.1 error on tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failure/Error: @user_profile = @user.create_user_profile(@attr) | |
ActiveRecord::RecordNotSaved: | |
Failed to remove the existing associated user_profile. The record failed to save when after its foreign key was set to nil. |
Adding :dependent => :destroy to the :has_one attribute of the model solves the problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Having a similar issue...any solution?