Major Change to Hash.from_xml in Rails 2.3.4

Recently after upgrading a Rails app to Rails 2.3.4 I noticed my Soap service calls throwing errors. After a little investigation I found this commit:

The problem is that since String#underscore lowercases the string, any Hashes created using Hash.from_xml with xml that contain any capital letters in the node names will break when updating to Rails 2.3.4.

XML is case-sensitive, so reverting back to using underscore probably isn’t going to happen, but this is definitely something that should have been a bigger focus at the release of 2.3.4.

For apps using Hash.to_xml that would like to upgrade to Rails 2.3.4 with there existing codebase, I created a small plugin to revert back to the using .underscore when creating a hash from XML.

4 Comments

  1. Posted January 6, 2010 at 2:16 pm | Permalink

    Bradly, did you happen to publish your small plugin that fixes the Rails 2.3.4 case issue with Hash.from_xml? :-)

  2. Posted February 7, 2010 at 8:54 pm | Permalink

    Hi Mark,

    Yes, it is on Github here:
    http://github.com/bradly/rails_hash_from_xml_compatibility_fix

  3. Meredith Hall
    Posted February 8, 2010 at 2:04 pm | Permalink

    Hi Bradly,

    I am helping recruit for a Ruby on Rails developer for a startup company in San Diego and came across your profile today on Linked In. My client is looking for outstanding developers with a can-do, entrepreneurial spirit and a good background with Ruby. Are you in the market for a new opportunity? If so, let’s chat – I’d love to talk to you more.

    I look forward to hearing back from you!

    Meredith
    Technical Recruiter
    meredithmanchack@yahoo.com

  4. Posted May 28, 2010 at 8:48 pm | Permalink

    My friend and I were arguing about this! Now I know that I was right. lol! Thanks for making me sure!

    Sent from my iPad 4G

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*