Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Disambiguate attributes on ActiveResource errors

#6713

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.

Reported by Brian Durand · April 18th, 2011 @ 04:13 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Brian Durand
    Brian Durand
    • Tag changed from activeresource to activeresource, patch

    April 18th, 2011 @ 04:24 PM