visoft/ruby_odata — pull request #24 by joshuap (2013-06-03 18:58:28+00:00)
Title: Use absolute paths when building entry classes

When using nested expands, inline entries can contain deeply nested
properties and inline elements of their own. Rather than performing a
match on any node under the current, select only the *first level*
properties or inline entries nodes.

The bug I was having is this (arbitrary example):

```ruby
svc = OData::Service.new('...')
svc.Products.expand('Categories').expand('Categories/Sections')
products = svc.execute
```

`products.Categories` would contain both Category and Section classes, since it was matching *every* nested entry rather than just the first level for each Product entry node. Also, properties were not being set on the first expand associations - so `products.first.categories.first.ID` would be nil, even though the properties element was present for that category.