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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6312f8ac4880ea36a31ef47a6c1d851307ee5b9
4
- data.tar.gz: 431fe393f396890c009da5f4a74e402db077a4a8
3
+ metadata.gz: 8612efc584f34d7e880cfe02d66791eba5cdc639
4
+ data.tar.gz: feb72d046d18b9c097002ac65af76343f616fcbd
5
5
  SHA512:
6
- metadata.gz: 4e54d08cac5aebf07217e42beb28c35fd6f2487751481f9828537097f401f73b106756a6c511ad4b5cd2adec9235fa1319e77f85093be6b9e88313e44219f604
7
- data.tar.gz: 0c98c0c6fc5f27aed4a9d1ebe7e2012356ef0d305fee0a06a941322c9509d78dcf9739a72d135a0414ed1a49c7ded4f9f308e00e9f8a86b015829ea9b498d3b6
6
+ metadata.gz: 65e6a3c45fadbfc87546db2e1b8417207f19d12c26f0683bd621fb6e5b6714c66dd95f17e7a4b36895589404479c45b0a2fe6fb40a9811160381a105ff02995a
7
+ data.tar.gz: da5d009c2bfd51f56911c0838ed5ca8d0662e53c34630e75bd1b390b530993a25c7ff76d16e2650dea474b655c780204f9f6dcb0c9f96eda8adc3dd68adcc148
@@ -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.1 and later, and has test coverage for MySQL, PostgreSQL, and SQLite.
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.0, 2.2, 2.3.1
623
- * ActiveRecord 4.1, 4.2, and 5.0
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.each { |c| c.rebuild! }
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.each { |c| c.rebuild!(true) }
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.each { |n| n.send(:rebuild!) } # roots just uses the parent_id column, so this is safe.
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
@@ -1,3 +1,3 @@
1
1
  module ClosureTree
2
- VERSION = Gem::Version.new('6.4.0')
2
+ VERSION = Gem::Version.new('6.5.0')
3
3
  end
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.0
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-02-17 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord