tabulatr2 0.9.39 → 0.9.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tabulatr/data/sorting.rb +7 -3
- data/lib/tabulatr/version.rb +1 -1
- 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: ae1a361564e5e09da6f27ce3803f2e45b980b958a7716798372da8f0c6f609cd
|
4
|
+
data.tar.gz: b1484c767ee360602179fd08ccfd499988d455a570d6fb589101e180c4e41c7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b19980985effeceab7e1a677823e7e19909b86bb63a7e5a86848652dd2ea6ec8faee21f365c5e4844ed23830fbc2cf7f3f64e94de4c296226af74a769991b0
|
7
|
+
data.tar.gz: c01ab2d6f7973ebdaaca99671d67d842f3010377db6a323468c5b19e6d7bf1aa48963cb976447573032a350324b6556e98970d9cddcca0fa8bf6c89b234890e3
|
@@ -41,9 +41,13 @@ module Tabulatr::Data::Sorting
|
|
41
41
|
end
|
42
42
|
sort_by(column, orientation)
|
43
43
|
elsif @default_order.present?
|
44
|
-
|
44
|
+
if @default_order.is_a? String
|
45
|
+
@relation = @relation.reorder(Arel.sql @default_order)
|
46
|
+
else
|
47
|
+
@relation = @relation.reorder(@default_order)
|
48
|
+
end
|
45
49
|
else
|
46
|
-
@relation = @relation.reorder("#{@table_name}.#{@base.primary_key} desc")
|
50
|
+
@relation = @relation.reorder(Arel.sql "#{@table_name}.#{@base.primary_key} desc")
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
@@ -52,7 +56,7 @@ module Tabulatr::Data::Sorting
|
|
52
56
|
if sort_sql.respond_to? :call
|
53
57
|
@relation = sort_sql.call(@relation, orientation, "#{@table_name}.#{@base.primary_key}", @base)
|
54
58
|
else
|
55
|
-
@relation = @relation.reorder("#{sort_sql} #{orientation}")
|
59
|
+
@relation = @relation.reorder(Arel.sql "#{sort_sql} #{orientation}, #{@table_name}.id desc")
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
data/lib/tabulatr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabulatr2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Horn
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|