This project is archived and is in readonly mode.

#2069 ✓stale
Bart ten Brinke

Namespacing for activeresource

Reported by Bart ten Brinke | February 25th, 2009 @ 10:25 AM | in 3.x

If you have an Client object in your Rails app and you want to use ActiveResource to get Clients from another application, then these Client objects have to have exactly the same attributes or ActiveResource will break. Because in a real world situation a lot of people call models in their application by the same name, sometimes you do not want ActiveResource to assume this behaviour.

To fix this I added this namespace patch. When a namespace is defined, the ActiveResource resourcename will not be Client, but NameSpaceClient. This will make ActiveResource fall back to it's default 'unknown source' behaviour, making it possible to get remote resources with the same name.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages