This project is archived and is in readonly mode.

Equality Problems with ActiveResource::Base
Reported by rbpandey | September 23rd, 2008 @ 09:42 PM
The == method was improperly implemented. Therefore, the test provided in the patch would fail. Essentially, two resources with different prefix options passed the equality check. I don't think the .equal? should have been used in the object equality comparison implementation (== method), as per the RDoc for Object "it is used to determine object identity (that is, a.equal?(b) iff a is the same object as b)". For now, I think comparing, at minimum, the id and prefix_options fields is appropriate.
Comments and changes to this ticket
- 
            
         jack dempsey (jackdempsey) September 23rd, 2008 @ 10:14 PM- Tag set to activeresource, bug
 Makes sense to me--two resources with different prefix options shouldn't be equal. 
- 
            
         rbpandey September 25th, 2008 @ 06:36 PMHere is the latest patch. I added back the .equals check as I was confused by some buggy behavior in Base.reload. 
- 
         Pratik January 18th, 2009 @ 05:46 AM- Milestone cleared.
- Assigned user set to Pratik
 
- 
         Repository January 28th, 2009 @ 08:01 PM- State changed from new to resolved
 (from [6079ec1f77daf364a2b25cf651e9b3c9e1b95a16]) ActiveResource#eqls? and == should not take into account object identity and prefix options should be considered. [#1098 state:resolved] Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co... 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 
         1098 
          Equality Problems with ActiveResource::Base
        (from [6079ec1f77daf364a2b25cf651e9b3c9e1b95a16])
ActiveR... 1098 
          Equality Problems with ActiveResource::Base
        (from [6079ec1f77daf364a2b25cf651e9b3c9e1b95a16])
ActiveR...
 jack dempsey (jackdempsey)
      jack dempsey (jackdempsey)
 Pratik
      Pratik