commontator 6.3.2 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/commontator/thread.rb +13 -3
- data/app/views/commontator/threads/_show.html.erb +1 -1
- data/lib/commontator/engine.rb +6 -0
- data/lib/commontator/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b52a669ee098261a37c5670b3d964f7f5be3628ee9036471240fde923f77ec
|
4
|
+
data.tar.gz: 95b55b14e06b86d302ac9b5d75107015fe3f6dd787ba77ff5b30112bfc53bcb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14bdde0d9c9738efee797e609497d894f5e4d3bd77534f9fabc101b952e37d356b97579fe2ba2eaca6defea3d13bcc18276a20efd1c18ee92a7ff3296c8a6ac
|
7
|
+
data.tar.gz: e652e1739c6940111cae53b0a9fbc0c7fe3f8a4e251fd03f422c1ee501faad0382ffafffd331fa22ef66530b0a31fd820c444d582e3a1e7a139f25c2555bb6ad
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Commontator
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/commontator.svg)](https://badge.fury.io/rb/commontator)
|
4
|
-
[![
|
4
|
+
[![Tests](https://github.com/lml/commontator/workflows/Tests/badge.svg)](https://github.com/lml/commontator/actions?query=workflow:Tests)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/lml/commontator/badges/gpa.svg)](https://codeclimate.com/github/lml/commontator)
|
6
6
|
[![Code Coverage](https://codeclimate.com/github/lml/commontator/badges/coverage.svg)](https://codeclimate.com/github/lml/commontator)
|
7
7
|
|
@@ -8,6 +8,8 @@ class Commontator::Thread < ActiveRecord::Base
|
|
8
8
|
validates :commontable, presence: true, unless: :is_closed?
|
9
9
|
validates :commontable_id, uniqueness: { scope: :commontable_type, allow_nil: true }
|
10
10
|
|
11
|
+
RAILS_7_PRELOADER = Rails::VERSION::MAJOR >= 7
|
12
|
+
|
11
13
|
def config
|
12
14
|
@config ||= commontable.try(:commontable_config) || Commontator
|
13
15
|
end
|
@@ -147,9 +149,17 @@ class Commontator::Thread < ActiveRecord::Base
|
|
147
149
|
).tap do |nested_comments|
|
148
150
|
next unless is_votable?
|
149
151
|
|
150
|
-
|
151
|
-
|
152
|
-
|
152
|
+
if RAILS_7_PRELOADER
|
153
|
+
ActiveRecord::Associations::Preloader.new(
|
154
|
+
records: nested_comments.flatten,
|
155
|
+
associations: :votes_for,
|
156
|
+
scope: ActsAsVotable::Vote.where(voter: user)
|
157
|
+
).call
|
158
|
+
else
|
159
|
+
ActiveRecord::Associations::Preloader.new.preload(
|
160
|
+
nested_comments.flatten, :votes_for, ActsAsVotable::Vote.where(voter: user)
|
161
|
+
)
|
162
|
+
end
|
153
163
|
end
|
154
164
|
end
|
155
165
|
|
data/lib/commontator/engine.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
require 'commontator'
|
2
|
+
require 'sprockets/railtie'
|
2
3
|
|
3
4
|
class Commontator::Engine < ::Rails::Engine
|
4
5
|
isolate_namespace Commontator
|
5
6
|
|
7
|
+
# Files in installed gems don't change during development,
|
8
|
+
# but still cause issues in Rails 7 if autoloaded in an initializer
|
9
|
+
# To fix this, make sure they are autoloaded only once
|
10
|
+
config.autoload_once_paths = config.autoload_paths + config.eager_load_paths
|
11
|
+
|
6
12
|
config.assets.precompile += [ 'commontator/*.png' ]
|
7
13
|
end
|
data/lib/commontator/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
COMMONTATOR_VERSION = '
|
1
|
+
COMMONTATOR_VERSION = '7.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:
|
4
|
+
version: 7.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:
|
11
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sprockets-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: will_paginate
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|