rails/activeresource — pull request #41 by packagethief (2012-09-18 18:04:30+00:00)
Title: Fix nested attribute loading from anonymous classes under Ruby 1.9

In Ruby 1.8, anonymous classes have an empty string for a name. In Ruby 1.9, name is `nil`. This causes an error when loading nested attributes from an anonymous class as we determine its namespace. With this change, we'll stringify the name before we try to split it.

Why would you want to use anonymous classes like this? We use this pattern at 37signals to configure resource class options at runtime. For example, when requesting resources that are available at different hosts:

```ruby
class User < ActiveResource::Base
def self.on(account)
Class.new(self).tap do |subclass|
subclass.site = account.url
end
end
end

User.on(account).find(123)
```