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
Closes GH #1032
Fixed what looks like minor cut/paste error in documentation for ActiveRecord::Locking:Pessimistic