closure_tree 6.4.0 → 6.5.0
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/CHANGELOG.md +5 -0
- data/README.md +3 -3
- data/lib/closure_tree/hierarchy_maintenance.rb +3 -3
- data/lib/closure_tree/version.rb +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: 8612efc584f34d7e880cfe02d66791eba5cdc639
|
4
|
+
data.tar.gz: feb72d046d18b9c097002ac65af76343f616fcbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65e6a3c45fadbfc87546db2e1b8417207f19d12c26f0683bd621fb6e5b6714c66dd95f17e7a4b36895589404479c45b0a2fe6fb40a9811160381a105ff02995a
|
7
|
+
data.tar.gz: da5d009c2bfd51f56911c0838ed5ca8d0662e53c34630e75bd1b390b530993a25c7ff76d16e2650dea474b655c780204f9f6dcb0c9f96eda8adc3dd68adcc148
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 6.5.0
|
4
|
+
|
5
|
+
* Merged [PR 258](https://github.com/mceachen/closure_tree/pull/258) which improves hierarchy maintenance with large trees.
|
6
|
+
Thanks, [Nikolay Bekirov](https://github.com/nbekirov)!
|
7
|
+
|
3
8
|
### 6.4.0
|
4
9
|
|
5
10
|
* Merged [PR 236](https://github.com/mceachen/closure_tree/pull/236) which adds documentation for `has_closure_tree_root`.
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ for a description of different tree storage algorithms.
|
|
56
56
|
|
57
57
|
## Installation
|
58
58
|
|
59
|
-
Note that closure_tree only supports ActiveRecord 4.
|
59
|
+
Note that closure_tree only supports ActiveRecord 4.2 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
|
60
60
|
|
61
61
|
1. Add `gem 'closure_tree'` to your Gemfile
|
62
62
|
|
@@ -619,8 +619,8 @@ end
|
|
619
619
|
|
620
620
|
Closure tree is [tested under every valid combination](http://travis-ci.org/#!/mceachen/closure_tree) of
|
621
621
|
|
622
|
-
* Ruby 2.
|
623
|
-
* ActiveRecord 4.
|
622
|
+
* Ruby 2.2, 2.3
|
623
|
+
* ActiveRecord 4.2 and 5.0
|
624
624
|
* PostgreSQL, MySQL, and SQLite. Concurrency tests are only run with MySQL and PostgreSQL.
|
625
625
|
|
626
626
|
Assuming you're using [rbenv](https://github.com/sstephenson/rbenv), you can use ```tests.sh``` to
|
@@ -53,7 +53,7 @@ module ClosureTree
|
|
53
53
|
_ct.with_advisory_lock do
|
54
54
|
delete_hierarchy_references
|
55
55
|
if _ct.options[:dependent] == :nullify
|
56
|
-
self.class.find(self.id).children.
|
56
|
+
self.class.find(self.id).children.find_each { |c| c.rebuild! }
|
57
57
|
end
|
58
58
|
end
|
59
59
|
true # don't prevent destruction
|
@@ -79,7 +79,7 @@ module ClosureTree
|
|
79
79
|
_ct_reorder_siblings if !called_by_rebuild
|
80
80
|
end
|
81
81
|
|
82
|
-
children.
|
82
|
+
children.find_each { |c| c.rebuild!(true) }
|
83
83
|
|
84
84
|
_ct_reorder_children if _ct.order_is_numeric? && children.present?
|
85
85
|
end
|
@@ -110,7 +110,7 @@ module ClosureTree
|
|
110
110
|
def rebuild!
|
111
111
|
_ct.with_advisory_lock do
|
112
112
|
hierarchy_class.delete_all # not destroy_all -- we just want a simple truncate.
|
113
|
-
roots.
|
113
|
+
roots.find_each { |n| n.send(:rebuild!) } # roots just uses the parent_id column, so this is safe.
|
114
114
|
end
|
115
115
|
nil
|
116
116
|
end
|
data/lib/closure_tree/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: closure_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew McEachen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|