commontator 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/app/models/commontator/thread.rb +15 -7
 - data/lib/commontator/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: 493bb858e4b65e4edeb26a496fe56b93d9119ffd2555097af8ab84a016aa29a9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f6dd0195a93216cc8900c10de23e2055f4eb539cebd86410970f58b4f4724795
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
       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 
     | 
    
         
            -
                   
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
      
 53 
     | 
    
         
            +
                  fc.order(cc[:created_at].asc, cc[:id].asc)
         
     | 
| 
       46 
54 
     | 
    
         
             
                end
         
     | 
| 
       47 
55 
     | 
    
         
             
              end
         
     | 
| 
       48 
56 
     | 
    
         | 
    
        data/lib/commontator/version.rb
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            COMMONTATOR_VERSION = '6.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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2019-09-03 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     |