rails/activeresource — pull request #32 by salrepe (2012-06-21 20:08:47+00:00)
Title: Fix Errors#from_array refactor sorting the attributes keys

When ActiveResource grabs errors from an array of messages, if you have an attribute name compound, that starts like another attribute name, for example:

{:errors => {:phone => "is not valid", :phone_work => "can't be blank" }}

If phone is parsed first it's getting the error of phone_work too.
For this reason, sorting the array of attributes by length we can fix this problem.