It's failing using `validate: false` because it's ignoring the `house_id` that you have set and using the association that you have assigned before.

Not using `validate: false` and setting the `house_id` will also not raise `ActiveRecord::InvalidForeignKey`, because it will clear the association and make the `door` invalid (because you have the presence validation for house).