fetcheable_on_api 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 936c435eaac09ab3f50c5fe2fc650df5f857f99077a3a7cd24c9a7cbfa16bbeb
4
- data.tar.gz: 5f029dd6d1fe43c945f0740b947ce0242444a6d6b21a556bc93c6c43295f02fd
3
+ metadata.gz: 86236648008d977d8cf84a2b083af86581079912d4b1d7f10e801f098baa66b4
4
+ data.tar.gz: aed101c2b06e89e8d343af140d50d292cbe4e796061d3bdc426a7b768a804a9d
5
5
  SHA512:
6
- metadata.gz: 5e11946ac5da7685b8a10e5638fd05c9dd5d55f5cf95309ccd2398e4b597ccd324ce68b3bdb307b8ed305500797f8a758af2c1b805ffdd671e7ad3ca407810bc
7
- data.tar.gz: f60417bd41596796aba7191c24a5dcd2b077945b50ae11dccee646a8d0c6feb539b7b8aa5198e96b83b6eb19c0079f36f1ffefd28d83baadbeb21b37adeb2156
6
+ metadata.gz: ace285bdcafbd9946f312c7964528dba3be9a3da1a9f5e358fa5922be692593bf16685d7745c43f541bea6727b9c3f2819a067ddda1f6398a02beb68be066f58
7
+ data.tar.gz: 5aebd924fb07e8171021e6a5d9bf86806bf6c0b304709cf32e97917adb9e50d96706912aac4064087cefd02a98ad84d7bdbecc609816f969fe47b37b97941066
@@ -55,7 +55,7 @@ module FetcheableOnApi
55
55
  foa_valid_parameters!(:sort, foa_permitted_types: [String])
56
56
 
57
57
  ordering = format_params(params[:sort]).map do |attr_name, sort_method|
58
- arel_sort(attr_name, sort_method)
58
+ arel_sort(attr_name, sort_method, collection)
59
59
  end
60
60
 
61
61
  collection.order(ordering.compact)
@@ -63,7 +63,7 @@ module FetcheableOnApi
63
63
 
64
64
  private
65
65
 
66
- def arel_sort(attr_name, sort_method)
66
+ def arel_sort(attr_name, sort_method, collection)
67
67
  return if sorts_configuration[attr_name].blank?
68
68
 
69
69
  klass = class_for(attr_name, collection)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FetcheableOnApi
4
- VERSION = '0.2.2'.freeze
4
+ VERSION = '0.2.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetcheable_on_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabien