We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 35beaf5 + c2ad419 commit 467d15fCopy full SHA for 467d15f
2 files changed
lib/jsonapi/request.rb
@@ -234,7 +234,7 @@ def set_default_filters
234
end
235
236
def parse_sort_criteria(sort_criteria)
237
- return unless sort_criteria
+ return unless sort_criteria.present?
238
239
@sort_criteria = CSV.parse_line(URI.unescape(sort_criteria)).collect do |sort|
240
if sort.start_with?('-')
test/controllers/controller_test.rb
@@ -205,6 +205,12 @@ def test_index_filter_on_relationship
205
assert_equal 3, json_response['data'].size
206
207
208
+ def test_sorting_blank
209
+ get :index, {sort: ''}
210
+
211
+ assert_response :success
212
+ end
213
214
def test_sorting_asc
215
get :index, {sort: 'title'}
216
0 commit comments