Perhaps `variants` should always return an array.  So you can just do `variants.any?` to check if there are variants.

```
def variants
  raw_attributes["variants"].to_a
end
```