grape-listing 1.3.3 → 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: 753ca42cbbc590322ae50cc4deb2319abbf1ed42971f3465d47fd437ae59426b
4
- data.tar.gz: 8340c60d43bfaf42cd28507f78797802a2a02d59c5520ff538b20f5f2573a8d7
3
+ metadata.gz: 9e9f78cab49a00463a64709b1c5efea22644d2976bda312bcb4af3b33677400a
4
+ data.tar.gz: 58798072a6106da67aec4ced5c9bc28596d5262a5dc8cfb1298a7b61a755bffe
5
5
  SHA512:
6
- metadata.gz: 61b65a31634ecd111fa68f0769c80fc2668e9d80b8f61e262fc4f989e499232af1bdeacfe1c6abc711b81bf92f43c9c2630242b8c3229395c68c7a8b40e3c7f1
7
- data.tar.gz: e102f06d75c44ddc18b657cefe265f0d9fc6c9cff86640352be57079c1af8032a14bed7c3481e3418fe1e439af48b0ee549bd57bfa4ab43e2dee2bea67532e3f
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'] }&.first
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-listing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Павел Бабин