Disambiguate attributes on ActiveResource errors #1032

lighthouse-import opened this Issue May 16, 2011 · 1 comment


None yet
1 participant

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6713
Created by Brian Durand - 2011-04-18 15:13:14 UTC

The attached patch fixes an issue with deserializing errors returned from the server for ActiveResource records. The code for deserializing looks for the humanized name in the error messages to determine which errors belong to which attribute. However, when attributes start with the same word (i.e. "name" and "name_source"), the errors can be assigned incorrectly. The fix sorts attributes by length (descending) so that longer names are always assigned first if they exist.

Attachments saved to Gist: http://gist.github.com/971842

brunoadacosta pushed a commit to brunoadacosta/rails that referenced this issue May 25, 2011

Closes GH #1032
Fixed what looks like minor cut/paste error in documentation for ActiveRecord::Locking:Pessimistic

hisas pushed a commit to hisas/rails that referenced this issue May 9, 2017

Fix that comparing message equality set their raw Message-ID to their…
… parsed message_id

Message equality comparison assigned temporary Message-ID headers for
comparison then reassigned the original values. That meant the originals
were actually reset to the parsed values. Subtle lossiness.

Fixed by comparing duplicate messages with modified Message-ID headers
rather than making the changes in-place.

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