Skip to content

Commit cb4bdd3

Browse files
committed
Handle the case where sort params are omitted.
1 parent dabafa1 commit cb4bdd3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/jsonapi/resource.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ def module_path
520520
end
521521

522522
def construct_order_options(sort_params)
523+
return {} unless sort_params
524+
523525
sort_params.each_with_object({}) { |sort, order_hash|
524526
field = sort[:field] == 'id' ? _primary_key : sort[:field]
525527
order_hash[field] = sort[:direction]

0 commit comments

Comments
 (0)