diff options
author | Matthijs Langenberg <mlangenberg@gmail.com> | 2010-09-24 22:37:26 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-27 23:10:55 +0200 |
commit | 67a838574be000f329c0f340474bc9cec1aeca16 (patch) | |
tree | ea3c23a7a5b4df852e5fa041da1c03fc6f42576c /activeresource/test/fixtures | |
parent | dd83140b24dcb8a27e226c9de286318a44d7fab1 (diff) | |
download | rails-67a838574be000f329c0f340474bc9cec1aeca16.tar.gz rails-67a838574be000f329c0f340474bc9cec1aeca16.tar.bz2 rails-67a838574be000f329c0f340474bc9cec1aeca16.zip |
Fix broken module namespacing in ActiveResource with Ruby 1.9 [#5699 state:resolved]
Following namespace use case was broken with Ruby 1.9:
class Author < ActiveRecord::Base
...
end
module Api
class Book < ActiveResouce::Base
end
end
Let's say XML contains <book><author><name>John</name></author>....
Api::Book.first.author.class.to_s #=>
Ruby 1.8.7: "Api::Book::Author" (namespaced, correct),
Ruby 1.9: "Author" (toplevel, broken)
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/test/fixtures')
-rw-r--r-- | activeresource/test/fixtures/sound.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activeresource/test/fixtures/sound.rb b/activeresource/test/fixtures/sound.rb index 5c0ef5d55c..d9d2b99fcd 100644 --- a/activeresource/test/fixtures/sound.rb +++ b/activeresource/test/fixtures/sound.rb @@ -1,5 +1,9 @@ -module Asset +module Asset class Sound < ActiveResource::Base self.site = "http://37s.sunrise.i:3000" end end + +# to test namespacing in a module +class Author +end
\ No newline at end of file |