commontator 6.0.0 → 6.0.1

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: f72fc2d006727dfff3cf250d48273f122fb2932b6db8ebe9422e8ba624ad3290
4
- data.tar.gz: 658d3fd4fae52f45de97e2e626dea6594b5739129dcbe79686b1d8bcb517446f
3
+ metadata.gz: 493bb858e4b65e4edeb26a496fe56b93d9119ffd2555097af8ab84a016aa29a9
4
+ data.tar.gz: f6dd0195a93216cc8900c10de23e2055f4eb539cebd86410970f58b4f4724795
5
5
  SHA512:
6
- metadata.gz: b2542590cca9e1cc266fadfcb3b5783f675e12f116361c5f9ee1530a3f0c91ed845e60a52809286e6c3f625fa142729c4d7f19e6cda78f1af4f01e03782d89ad
7
- data.tar.gz: d3021862824f68bd2a14d3fb13511e6958721949f8843c8ce264a219e44ea1c8ea7df2fb471787ab18b2e9070da4d69ef1501177a6b9ab7dfafb23e2e8e45276
6
+ metadata.gz: 0b7e38a1081300cdf9ed8c711b295d0fc8494a0cafddb5c2f03f96a4041770edef63d1a11e4e74046c3f23e6cb51f770d26b224ea8c597da4b021f706ff7932b
7
+ data.tar.gz: 033432442ad4e7f81d382398e0e37eeea3bcd46c54e627ecef298e435c3f186244e264cebc300527e727b365b9a82e1769e1d782571535668499448f8459e18d
@@ -30,19 +30,27 @@ class Commontator::Thread < ActiveRecord::Base
30
30
  end
31
31
 
32
32
  def ordered_comments(show_all)
33
- vc = filtered_comments(show_all)
33
+ fc = filtered_comments(show_all)
34
34
  cc = Commontator::Comment.arel_table
35
+
36
+ # ID is used as a tie-breaker because MySQL lacks sub-second timestamp resolution
35
37
  case config.comment_order.to_sym
36
38
  when :l
37
- vc.order(cc[:created_at].desc)
38
- when :e
39
- vc.order(cc[:created_at].asc)
39
+ fc.order(cc[:created_at].desc, cc[:id].desc)
40
40
  when :ve
41
- vc.order((cc[:cached_votes_down] - cc[:cached_votes_up]).asc, cc[:created_at].asc)
41
+ fc.order(
42
+ Arel::Nodes::Descending.new(cc[:cached_votes_up] - cc[:cached_votes_down]),
43
+ cc[:created_at].asc,
44
+ cc[:id].asc
45
+ )
42
46
  when :vl
43
- vc.order((cc[:cached_votes_down] - cc[:cached_votes_up]).asc, cc[:created_at].desc)
47
+ fc.order(
48
+ Arel::Nodes::Descending.new(cc[:cached_votes_up] - cc[:cached_votes_down]),
49
+ cc[:created_at].desc,
50
+ cc[:id].desc
51
+ )
44
52
  else
45
- vc
53
+ fc.order(cc[:created_at].asc, cc[:id].asc)
46
54
  end
47
55
  end
48
56
 
@@ -1 +1 @@
1
- COMMONTATOR_VERSION = '6.0.0'
1
+ COMMONTATOR_VERSION = '6.0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commontator
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails