Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a :camelize option to ActiveRecord and Hash to_xml serializatio…
…n and from_xml deserialization Signed-off-by: Michael Koziarski <michael@koziarski.com>
- Loading branch information
Showing
4 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aa5cdb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, do you know how much code you broke by forcing “dasherize” upon us? I (and plenty of others) are using xml docs that are posted to an action, and taking advantage of the fact that the doc is busted out into a Hash that is added to params.
I have to either figure out how to persuade rails to set :dasherize to false, or go through a couple hundred lines of code and dasherize what I have. Either way, my code will only work on the latest version of rails.
This is a major change, and the default should always be to continue to do whatever was done historically, unless that historic functionality is broken.
aa5cdb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, it’s not “dasherize”. The issue is line 223 of hash/conversions.rb – adding “underscore”. Same problem, though, and a major change in functionality.
aa5cdb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a bug, please file a ticket on lighthouse and assign it to me, ideally with a test case for what’s broken.
aa5cdb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can push out a point release to address this.
aa5cdb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Michael,
I created a patch for Hash#from_xml not working with all caps keys due to this commit and assigned it to you. https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2604