grape-listing 1.3.2 → 1.3.4

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: 91c1e4c2304b5a8918099f9d66fe17adb0867d70dc3e31c4e1d8ddd4f4763bb2
4
- data.tar.gz: 43c297e7791da7cc815f893f1ed8e920047799f35633f4facf174911874c6c88
3
+ metadata.gz: 9e9f78cab49a00463a64709b1c5efea22644d2976bda312bcb4af3b33677400a
4
+ data.tar.gz: 58798072a6106da67aec4ced5c9bc28596d5262a5dc8cfb1298a7b61a755bffe
5
5
  SHA512:
6
- metadata.gz: 38e71d0a6b5b79d13923c4e1950fd6fe9d51732eb57fcf7efe87546a473b93be40994f131beeadd7db0d24ed5b77612997676e472e0e993ccac4d0056f7891a3
7
- data.tar.gz: b24ea490f428720e199ffb8029bcfc96abd0f13d471dbc68c8125fe6455b14f19be3d17a7040f7b2cf488199040961586f55ffc258b6a0d57b7469c9b03a643c
6
+ metadata.gz: 909c1fe75c99020114703d5a9a310fdeb122d09718eb29e7bdfa5f49bfdcd3c793048451af410ae40ade813bd56165cd94b5cfb36cf3284910d10de63187522e
7
+ data.tar.gz: a913163ce0ca336ad5ccd8186d2744e435ec255c648569ed75fe2e505dc89f65b36c6b30388dbfca7f104e6ee1f9f5f1a8d8ff0bbe935fa7d3ac303a198b8168
@@ -5,7 +5,7 @@ module GrapeListing
5
5
 
6
6
  def sort_proc
7
7
  # проверка необходимости нестандартной сортировки
8
- unless custom_sorting_field
8
+ if !@sortable.is_a?(Array) || @sortable.empty? || custom_sorting_field.blank?
9
9
  return proc { order('id DESC NULLS LAST') }
10
10
  end
11
11
 
@@ -22,7 +22,7 @@ module GrapeListing
22
22
 
23
23
  # поиск поля для индивидуальной сортировки среди допустимых
24
24
  def custom_sorting_field
25
- @custom_sorting_field ||= @sortable.select { |i| i.split('|')[0] == @params['sort_by'] }[0]
25
+ @custom_sorting_field ||= @sortable.select { |i| i.split('|')[0] == @params['sort_by'] }.first
26
26
  end
27
27
 
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-listing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Павел Бабин
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack