nesquena/rabl — pull request #247 by DushyanthMaguluru (2012-05-22 03:33:17+00:00)
Title: Alternative solution to check if an object is a collection

Hi nesquena,

One of my object fails to output any json as it has a custom method named map.

```
class Item
def map
self.maps.first
end
end
```

I noticed that the is_collection and is_object methods use "data_object(obj).respond_to?(:map)" which was causing the object_to_hash method in the Partials module to work incorrectly.

So I replaced it with "data_object(obj).class.include?(Enumerable)". Seems to fix my issue. Is this the correct fix for the problem?

Thanks,
Dushyanth