toptal/chewy — pull request #10 by undr (2014-02-28 04:03:22+00:00)
Title: Fix bug in compose method

When we define field with `object` type and nested fields, like that:

```ruby
field :name, type: 'object', boost: 10, value: ->(){ name_translations } do
field :ru, value: ->(name){ name['ru'] }
field :en, value: ->(name){ name['en'] }
end
```

We get the error during indexation, because method `compose` converts any `Hash` to `Array` by using method `map`:

```ruby
result = if result.is_a?(Enumerable)
result.map { |object| nested_compose(object) }
else
nested_compose(result)
end if nested.any? && !multi_field?
```

`Hash` is `Enumerable`. Iterating through `Hash` converts it to `Array`