samvera / hydra-pcdm

Samvera implementation of the PCDM model
Other
11 stars 10 forks source link

Ancestor test fails when collections/objects aren't saved #119

Closed elrayle closed 9 years ago

elrayle commented 9 years ago

ancestor? test checks ids aren't equal. So when collections/objects aren't saved, this fails because all ids are nil and therefore are equal.

Recommendation: do object equality instead of id equality

elrayle commented 9 years ago

Fixed by pull request https://github.com/projecthydra-labs/hydra-pcdm/pull/120

elrayle commented 9 years ago

Based on feedback, there is a preference for checking the ids if they exist and only doing object equality when either the parent or child has a nil id.

tpendragon commented 9 years ago

@elrayle Ah, sorry, I may have been hasty then. I thought since the edge cases were handled via object equivalence that we didn't want to handle it again.

elrayle commented 9 years ago

Based on discussions in the following issues, object equivalence is the most efficient approach. Testing of object equivalence is inherited from ActiveFedora:Base core.rb == method.