Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Changed the identity_map test for belongs_to methods to look at the
Browse files Browse the repository at this point in the history
target of the association instead of the association itself. The
association doesn't return the object you're looking for, it instead
returns a proxy object. Since this isn't actually an instance of the
class of the association, it will never be the same object as what
you're looking for. if you use #target, however, it gives you access
to the underlying object, which should be the same as one called
straight from the db.
  • Loading branch information
pjdavis committed Mar 9, 2010
1 parent ac22721 commit 438333c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/identity_map_spec.rb
Expand Up @@ -21,7 +21,7 @@
it "should work for belongs_to assocations" do
d1 = Customer.first
d2 = PhoneNumber.first.customer
d1.__id__.should == d2.__id__
d1.__id__.should == d2.target.__id__
end

it "should work for creating objects" do
Expand Down

0 comments on commit 438333c

Please sign in to comment.