commontator 6.0.0.pre.2 → 6.0.0

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: 3b104df98e58a375c90e006da5b5dfe15833cbc12bd8bc19a1c7deb5fe47fb50
4
- data.tar.gz: f7b5f7d780315910e49e6989f58d98d2bf085dcd27007086ec1c4554b7f1d0a0
3
+ metadata.gz: f72fc2d006727dfff3cf250d48273f122fb2932b6db8ebe9422e8ba624ad3290
4
+ data.tar.gz: 658d3fd4fae52f45de97e2e626dea6594b5739129dcbe79686b1d8bcb517446f
5
5
  SHA512:
6
- metadata.gz: 99f7eeda6f7d0208640dbe86a98b047ae1092460836bbf8d1d13e200993aad7dc505e12fb793bdfc4fca9aff1c01498ea479368772022c1b6e47a65b0636f8af
7
- data.tar.gz: b0db208a7f29d5d3ab311c2ec9d044c86a205e08c79b335621e70a2b9af1027b3c146356b121d768c02c63f85708e57f453a51fe4b15d70523f1e1534b0afb7a
6
+ metadata.gz: b2542590cca9e1cc266fadfcb3b5783f675e12f116361c5f9ee1530a3f0c91ed845e60a52809286e6c3f625fa142729c4d7f19e6cda78f1af4f01e03782d89ad
7
+ data.tar.gz: d3021862824f68bd2a14d3fb13511e6958721949f8843c8ce264a219e44ea1c8ea7df2fb471787ab18b2e9070da4d69ef1501177a6b9ab7dfafb23e2e8e45276
@@ -55,7 +55,7 @@ class Commontator::Thread < ActiveRecord::Base
55
55
  [ :i, :b ].include?(config.comment_reply_style) ? oc.where(parent_id: parent_id) : oc
56
56
  end
57
57
 
58
- def paginated_comments(page = 1, parent_id, show_all)
58
+ def paginated_comments(page, parent_id, show_all)
59
59
  cp = comments_with_parent_id(parent_id, show_all)
60
60
 
61
61
  cp.paginate(page: page, per_page: config.comments_per_page[0])
@@ -90,10 +90,10 @@ class Commontator::Thread < ActiveRecord::Base
90
90
  if [ :i, :b ].include? config.comment_reply_style
91
91
  all_parent_ids = comments.map(&:id)
92
92
  (config.comments_per_page[1..-1] + [ 0 ]).each_with_index do |per_page, index|
93
- ordered_comments(show_all).where(parent_id: all_parent_ids)
94
- .group(:parent_id)
95
- .count
96
- .each do |parent_id, count|
93
+ filtered_comments(show_all).where(parent_id: all_parent_ids)
94
+ .group(:parent_id)
95
+ .count
96
+ .each do |parent_id, count|
97
97
  count_by_parent_id[parent_id] = count
98
98
  per_page_by_parent_id[parent_id] = per_page
99
99
  end
@@ -103,10 +103,12 @@ class Commontator::Thread < ActiveRecord::Base
103
103
  children = all_parent_ids.empty? ? [] : Commontator::Comment.find_by_sql(
104
104
  all_parent_ids.map do |parent_id|
105
105
  Commontator::Comment.select(Arel.star).from(
106
- Arel::Nodes::Grouping.new(
107
- Arel::Nodes::SqlLiteral.new(
108
- ordered_comments(show_all).where(parent_id: parent_id).limit(per_page).to_sql
109
- )
106
+ Arel::Nodes::TableAlias.new(
107
+ Arel::Nodes::Grouping.new(
108
+ Arel::Nodes::SqlLiteral.new(
109
+ ordered_comments(show_all).where(parent_id: parent_id).limit(per_page).to_sql
110
+ )
111
+ ), :commontator_comments
110
112
  )
111
113
  ).to_sql
112
114
  end.reduce { |memo, sql| memo.nil? ? sql : "#{memo} UNION ALL #{sql}" }
@@ -234,7 +234,7 @@ Commontator.configure do |config|
234
234
  # The array represents how many comments to load at each nesting level, with the
235
235
  # first number corresponding to the current level, the second number to the next level, etc
236
236
  # Note: large values WILL cause performance and memory issues with many nested comments
237
- # The maximum number of comments loaded at once is for the default setting is:
237
+ # The maximum number of comments loaded at once for the default setting is:
238
238
  # 20 + 20*5 + 20*5*2 == 320
239
239
  # Default: [ 20, 5, 2 ]
240
240
  config.comments_per_page = [ 20, 5, 2 ]
@@ -1 +1 @@
1
- COMMONTATOR_VERSION = '6.0.0.pre.2'
1
+ COMMONTATOR_VERSION = '6.0.0'
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.pre.2
4
+ version: 6.0.0
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-07-14 00:00:00.000000000 Z
11
+ date: 2019-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -246,9 +246,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  requirements:
249
- - - ">"
249
+ - - ">="
250
250
  - !ruby/object:Gem::Version
251
- version: 1.3.1
251
+ version: '0'
252
252
  requirements: []
253
253
  rubygems_version: 3.0.4
254
254
  signing_key: