The current implementation of the private method find_or_create_resource_for in ActiveResource::Base does not find resources
if their class is defined in nested modules. At the moment, it only handles a single level of namespace.
Let's say you have two resources defined in a nested module :
module Highrise
module Resources
class Note < ActiveResource::Base
# ...
end
class Comment < ActiveResource::Base
# ...
end
end
end
When you load a Note which contains a nested collection of Comments, the current implementation will
actually create an array of Highrise::Resources::Note::Comment adhoc resources instead of using the existing
class Highrise::Resources::Comment.
This patch addresses this problem by walking through the class namespace to find the definition
of the resource. If no class is found in the nested modules, it will be created.
This patch comes with two new unit tests which ensures that the correct Resource is loaded and
that ActiveResource can find classes defined at different levels in different nested modul