shopify_app: :order => "created_at DESC" is not a valid parameter for the Order query
In: home_controller.rb Line: 15
https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/templates/app/controllers/home_controller.rb#L15
The :order => "created_at DESC" parameter is not valid. In other words, it does not work.
This is because the Shopify API is an ActiveResource, the parameter order does not work in the same way that it would with an ActiveRecord model.
limit is one of the end points of Order, so that parameter works.
http://docs.shopify.com/api/order#index
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 16 (12 by maintainers)
@yu-coder
order_idmaybe, but notorder_numberas that doesn’t exist as a parameter.As a way of getting around the problem, I have had to use:
.sort_by(&:created_at)or.sort_by(&:created_at).reverseFor example:
Could you indicate what doesn’t work? Because when I run the following queries, it does exactly what I expect:
The former shows the first 5, the latter the last 5.