order_by returls undefined method `encoding'
kevinrademan opened this issue · comments
I'm trying to use the keen ruby to do the following query which includes an order by. I used the documentation here to construct this query
https://keen.io/docs/api/#order-by
keen_client
.send("count_unique", "test_collection", {
target_property: 'tmp.someid',
group_by: 'tmp.otherid',
timeframe: {:start=>"Wed, 30 May 2018 15:03:06 UTC +00:00", :end=>"Fri, 29 Jun 2018 15:03:06 UTC +00:00"},
order_by: { :property_name => 'result', :direction => 'DESC' }
})
This returns the following error
NoMethodError in TestController#index_tmp
undefined method `encoding' for {:property_name=>"result", :direction=>"DESC"}:Hash
Using order_by: "result" seems to work, but then I'm not able to specify the sort direction.
Is this perhaps a bug in the library, or am I specifying the order by incorrectly?