I've half solved my own problem. ActiveResource#save uses #encode which uses ActiveResource#to_xml
The documentation for ActiveResource#to_xml states that :dasherize defaults to false. In fact in the code for Hash#to_xml, which it calls, it defaults to true. So #encode calls #to_xml with the default, hence all the underscores in field names on ActiveResources get converted into hyphens when you save the record. I've logged a ticket on lighthouse and vendorized rails and made a temporary fix to the code for my own setup. Question is, how come this massive error wasn't spotted? Well it is a show stopper if you're using ActiveResource to access non-Rails systems via REST, but I guess if you aren't you'd never run into the problem. Which to me implies there aren't many people using REST to do system integration between Rails and non-Rails systems. Are there many people using REST to integrate with non-Rails systems? Comments please. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

