karmi/tire — pull request #722 by platzhirsch (2013-05-02 21:52:20+00:00)
Title: Fix incomplete nested to_hash functionality

Issue #339 addressed the lacking functionality for the `to_hash` to work in a recursive fashion. This was fixed, however, I noticed it does not work if `Tire::Results::Item` contains an array with `Tire::Results::Item` objects. In this case the array is just skipped.

```
,
awards:
>,
reviews: [
,

]
```

becomes

```
{:title=>"Test", :author=>{:name=>"Kafka"},
:awards=>{:best_fiction=>{:year=>"1925"}},
:reviews=>[
,

]}
```

and not as expected

```
{:title=>"Test", :author=>{:name=>"Kafka"},
:awards=>{:best_fiction=>{:year=>"1925"}},
:reviews=>[{:stars=>5, :comment=>"great"},
{:stars=>3, :comment=>"decent"}]}
```

I have extended the unit test case to reveal this problem and added a fix. I hope this helps, at least I need this, as I was expecting this behavior. I am also curious if there is an alternative, more elegant, implementation to my solution.