@new_record round trip with associations problem #3720

Closed
kennyj opened this Issue Nov 22, 2011 · 3 comments

Projects

None yet

3 participants

@kennyj
kennyj commented Nov 22, 2011

When investigating to fix the warning, I faced a strange problem.

The next testcase is failed (line no 1920).
kennyj@a04ae46

This problem is reproduced on cruby 1.9.2-p180 and 1.9.3-p0, but one isn't reproduced (success) on ree-1.8.7-2011.03

It seems that there is @new_record instance variable in dump string, but loaded object is not defined @new_record.

related to #2431 ?

/cc @jonleighton

@carlosantoniodasilva carlosantoniodasilva added a commit to carlosantoniodasilva/rails that referenced this issue Mar 4, 2012
@carlosantoniodasilva carlosantoniodasilva Initialize @stale_state to nil in association
This apparently fix the warning related to @new_record variable not
being initialized in AR's test suit, when an association is built and
the object is marshalled/loaded.

See these tests in AR's base_test.rb:

test_marshalling_with_associations
test_marshalling_new_record_round_trip_with_associations

Closes #3720.
9b9357b
@steveklabnik
Member

Was this fixed when #5268 was merged?

@carlosantoniodasilva

@steveklabnik yes, I believe so. My bad, I completely forgot to close this one. Thanks!

@steveklabnik
Member

:D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment