the_comments 2.2.1 → 2.2.2
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/assets/stylesheets/the_comments.css.scss +2 -0
- data/app/models/concerns/comment_states.rb +8 -2
- data/config/initializers/the_comments.rb +1 -0
- data/gem_version.rb +1 -1
- data/lib/the_comments/config.rb +4 -1
- data/the_comments.yml.teamocil.example +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49fd19e10fb5ca5adbbb061aced7c0c844b85bac
|
4
|
+
data.tar.gz: 36c6ab87c989e3bb71f108f382537084bf6aa78e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ea2f9f5bf511f4350efc70c0a53a65c4db5cdeb0fcbe98e09d33afc6c9c57d5ab88a766b7e0e6db4ec1c21f9db209af10b9546285b0c414fe85f4920e56fea1
|
7
|
+
data.tar.gz: 096802337316119520c1811ecc7e463adb9f684deab5f97a7a4ba64d3c0137a53def4d110f292d65be7c237d5bd7eed4edc079bf03f86093244f8f865a12a6b4
|
data/README.md
CHANGED
@@ -47,8 +47,14 @@ module TheComments
|
|
47
47
|
|
48
48
|
# to deleted (cascade like query)
|
49
49
|
after_transition [:draft, :published] => :deleted do |comment|
|
50
|
-
|
51
|
-
|
50
|
+
|
51
|
+
if TheComments.config.delete_descendants_on_node_delete
|
52
|
+
ids = comment.self_and_descendants.map(&:id)
|
53
|
+
::Comment.where(id: ids).update_all(state: :deleted)
|
54
|
+
else
|
55
|
+
id = comment.id
|
56
|
+
::Comment.where(id: id).update_all(state: :deleted)
|
57
|
+
end
|
52
58
|
|
53
59
|
@owner.try :recalculate_my_comments_counter!
|
54
60
|
@holder.try :recalculate_comcoms_counters!
|
data/gem_version.rb
CHANGED
data/lib/the_comments/config.rb
CHANGED
@@ -19,7 +19,8 @@ module TheComments
|
|
19
19
|
:default_title,
|
20
20
|
:template_engine,
|
21
21
|
:empty_trap_protection,
|
22
|
-
:tolerance_time_protection
|
22
|
+
:tolerance_time_protection,
|
23
|
+
:delete_descendants_on_node_delete
|
23
24
|
end
|
24
25
|
|
25
26
|
configure do |config|
|
@@ -33,5 +34,7 @@ module TheComments
|
|
33
34
|
|
34
35
|
config.empty_trap_protection = true
|
35
36
|
config.tolerance_time_protection = true
|
37
|
+
|
38
|
+
config.delete_descendants_on_node_delete = true
|
36
39
|
end
|
37
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_comments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya N. Zykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: state_machine
|