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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1706d3a41110804765176f50317e42e25df7a08f8c0834591ea042b72ab2366f
4
- data.tar.gz: ec5fb3df2608a5997e81366c3cc8bbe0694703a49d38e130de6ae69ba3905304
3
+ metadata.gz: ae1a361564e5e09da6f27ce3803f2e45b980b958a7716798372da8f0c6f609cd
4
+ data.tar.gz: b1484c767ee360602179fd08ccfd499988d455a570d6fb589101e180c4e41c7f
5
5
  SHA512:
6
- metadata.gz: d77e36296a6aa444ae874dfe67748db7fcbe57bfc1ebd2f2db4629f7c4a65d501aa89c0ac62888dd2c621701983ee5119893107ad89e8fa0f2580387dacafc4e
7
- data.tar.gz: 9d2ecd814d67f2bb64d59492f3460ff0a959fcf5326c9de4df32e6c6e7b20026b40e676115d9069e6be6fbb42a196906ca2b13ad97466b404b82e70bb2a0018a
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
- @relation = @relation.reorder(@default_order)
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
 
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module Tabulatr
25
- VERSION = "0.9.39"
25
+ VERSION = "0.9.40"
26
26
  end
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.39
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-08-29 00:00:00.000000000 Z
13
+ date: 2019-10-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails