json-logic-ruby
json-logic-ruby copied to clipboard
fix: Fix uses_data to resolve var arrays correctly
There is a bug within uses_data. It takes only the first value for var values. It should take all. Consider the below example
```
{
"all" => [
{ "var"=> "a" },
{ "var"=> ["b", "c"] }
],
}
```
Calling `uses_data` on this should yield `["a", "b", "c"]` but instead only yields ["a", "b"].
Testing this on the online playground at https://jsonlogic.com/play.html with the data `{ "a": ["foo", "bar", "baz"], "b": "foo", "c": "bar" }` yields true. The actual JSONLogic is correct here but specifically `uses_data` is incorrect.
This PR attempts to fix this by always taking all values instead of the first.