Take the 2-minute tour ×

I'm upgrading a rail2 app to rails3, and experiencing some weird behavior with the way ActiveResource is consuming a REST api (also a rails app). The XML response from the api looks something like:

    <name>Company Name</name>
        <name>Employee 1</name>

Now I am able to consume the api correctly, and dot notation seems to work fine...i.e.:

company.employee.name #returns Employee 1

However, I noticed that the class type of nested attributed is different than it was in rails 2. In rails two, the class types (based on the XML above), would be:


However, in rails 3, the class types are:


For some reason, it is namespacing the classes. I have already defined each of the ActiveResource classes for each of these types (non-namespaced), and because rails3 is namespacing things, it is not mapping to the classes I have defined.

Anyone know if there is a way to turn this off?

share|improve this question
add comment

1 Answer

Took some digging around, but I discovered that this is because the models have not been loaded yet.

I've filed a ticket here (with a temporary workaround): https://github.com/rails/rails/issues/5148

share|improve this answer
add comment

Your Answer


