commontator 6.1.0 → 6.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c63a6212f25d57ea206e1cfb23f4c8dff604ce26f6fb1a5d1ddb0088b030a4a5
4
- data.tar.gz: 23ecd8f13e5af29e8968882361b2e87506d80ac23a209e4116c638a63514f46e
3
+ metadata.gz: 0b43492888aa32e2a5281147f5b8fa373bf4368fdac7e251f56652aee7263c6e
4
+ data.tar.gz: df8792352f99e43ae5bb707c73b8f7e2761d4172659816895603d1dc8d3a053d
5
5
  SHA512:
6
- metadata.gz: 04c523c45acc09a1062fbeeefbe1e328ee439b7f929f9fdb5d00a7d510d547434d2648cfbb1326d6ad0e7c182d91e2c745839434ac948af297fce964cb2c0724
7
- data.tar.gz: 64b8731da68531908d2230936f21d647a5b2567d044490ebdbce8d85aa2dcdddff84ae68f31bd88b282df59f5ca7df19d2bf9d657a644715a0f6324c3e8ae548
6
+ metadata.gz: 8d8149b165e5a4a1b3dfe9b9035129fd1fa232c9c65b0b5852bb5944ea3e2e9188142124e376821ca624b268e19ba32a5a762de1416b72a4690d23325c9cf897
7
+ data.tar.gz: 2c47c72b76baf4687caae23c5e6d5348e5ee4f1d987ef2ce6b07f22225e39d15be3a3cd2a450442c19bad1aa0712c7ed534e44cdb1f637d73f25518dbfdd45e5
@@ -60,7 +60,17 @@ class Commontator::Thread < ActiveRecord::Base
60
60
 
61
61
  def comments_with_parent_id(parent_id, show_all)
62
62
  oc = ordered_comments(show_all)
63
- [ :i, :b ].include?(config.comment_reply_style) ? oc.where(parent_id: parent_id) : oc
63
+
64
+ if [ :i, :b ].include?(config.comment_reply_style)
65
+ # Filter comments by parent_id so we display nested comments
66
+ oc.where(parent_id: parent_id)
67
+ elsif parent_id.nil?
68
+ # Parent is the thread itself and nesting is disabled, so include all comments
69
+ oc
70
+ else
71
+ # Parent is some comment and nesting is disabled, so return nothing
72
+ oc.none
73
+ end
64
74
  end
65
75
 
66
76
  def paginated_comments(page, parent_id, show_all)
@@ -1 +1 @@
1
- COMMONTATOR_VERSION = '6.1.0'
1
+ COMMONTATOR_VERSION = '6.1.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.1.0
4
+ version: 6.1.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-20 00:00:00.000000000 Z
11
+ date: 2019-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails