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 +4 -4
- data/lib/listing_service/sorting.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e9f78cab49a00463a64709b1c5efea22644d2976bda312bcb4af3b33677400a
|
4
|
+
data.tar.gz: 58798072a6106da67aec4ced5c9bc28596d5262a5dc8cfb1298a7b61a755bffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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'] }
|
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.
|
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-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|