diff options
author | Luis Hurtado <luisfelipehurtado@gmail.com> | 2008-06-09 21:39:39 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-09 23:06:07 -0700 |
commit | 225065709c43dacd57e0904aef2075024ccf2744 (patch) | |
tree | 97bb64adfd245513c9c5fcd8aa9f929cc19013fc /activeresource/lib/active_resource | |
parent | 16a9787bf034a4de36a35b647c456ef142f814e1 (diff) | |
download | rails-225065709c43dacd57e0904aef2075024ccf2744.tar.gz rails-225065709c43dacd57e0904aef2075024ccf2744.tar.bz2 rails-225065709c43dacd57e0904aef2075024ccf2744.zip |
Fixes parsing deep nested resources from XML. [#380 state:resolved]
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 55dacfdf06..347dbb82aa 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -988,7 +988,11 @@ module ActiveResource self.class.const_get(resource_name) end rescue NameError - resource = self.class.const_set(resource_name, Class.new(ActiveResource::Base)) + if self.class.const_defined?(resource_name) + resource = self.class.const_get(resource_name) + else + resource = self.class.const_set(resource_name, Class.new(ActiveResource::Base)) + end resource.prefix = self.class.prefix resource.site = self.class.site resource |