awesome_nested_set 3.3.1 → 3.4.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
  SHA256:
3
- metadata.gz: 21d0bfb95d740009c0df08b796d8cc8a7fcffb329a7071e3e8abac8b6b5bc4ad
4
- data.tar.gz: 1ef4e781fe0300d2316ca1f6bbdcce5c208618e3a7ac0aa5fc0966a5ea8b8bea
3
+ metadata.gz: 5145938ca7a83f2c7f17b21792d96b43fc7c3e7ad90827af1e54bfc69b67d455
4
+ data.tar.gz: a7c20bb47b946a37e4946ca73577f292679e85624aeb03f75762be7b1e3bc3d7
5
5
  SHA512:
6
- metadata.gz: a98ce815f1e820457f7e2b87358b8af5cc584c894bd08ef531d32abeb92aaf64d484edbdac6ef264bab8b03d946b2bb68f6eb3433fd27a0516ef2de69fa7fd7a
7
- data.tar.gz: ed46eb2b3a4311aead5153608bb26c99add49a796eacfbc5ba910f7854614015bf8bea1bfa63181ebe602692d14864de0866625600326037a65aa468fd98ca89
6
+ metadata.gz: b5af92810fd9120cbc84f7ea9f70b444a9331c4ac532e80b03a7c88a506f63a72e80d84ee0b536dfa8f2691c3351d922d55812149188670d45c3945c91a8a651
7
+ data.tar.gz: 9abe2f9c68010fe4f8105949afc7ecb9941d0897d89bdc0e994920f7a4dec41b2ee1e372e52bc947cbce8395eedec18546d34ce873ba2e9694a53e4b6ab7ea95
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased version
2
2
 
3
- * [Compare to 3.3.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...master)
3
+ * [Compare to 3.4.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...master)
4
+
5
+ 3.4.0
6
+ * Keep current scope when calling `roots` [Petrik de Heus](https://github.com/p8)
7
+ * STI record now can update counter cache correctly [Issei Murasawa](http://github.com/issei-m)
8
+ * [Compare to 3.3.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...master)
4
9
 
5
10
  3.3.1
6
11
  * Add belongs_to :polymorphic key option only when used [Filippo Liverani](https://github.com/filippoliverani)
@@ -80,12 +80,7 @@ module CollectiveIdea #:nodoc:
80
80
 
81
81
  def nested_set_scope(options = {})
82
82
  order = scope_order_from_options(options)
83
- default_scoped.where(options[:conditions]).order(order)
84
- end
85
-
86
- def nested_set_scope_without_default_scope(options = {})
87
- order = scope_order_from_options(options)
88
- unscoped.where(options[:conditions]).order(order)
83
+ where(options[:conditions]).order(order)
89
84
  end
90
85
 
91
86
  def primary_key_scope(id)
@@ -151,7 +146,7 @@ module CollectiveIdea #:nodoc:
151
146
  def nested_set_scope(options = {})
152
147
  add_scope_conditions_to_options(options)
153
148
 
154
- self.class.base_class.nested_set_scope options
149
+ self.class.base_class.default_scoped.nested_set_scope options
155
150
  end
156
151
 
157
152
  # Separate an other `nested_set_scope` for unscoped model
@@ -162,7 +157,7 @@ module CollectiveIdea #:nodoc:
162
157
  def nested_set_scope_without_default_scope(options = {})
163
158
  add_scope_conditions_to_options(options)
164
159
 
165
- self.class.base_class.nested_set_scope_without_default_scope options
160
+ self.class.base_class.unscoped.nested_set_scope options
166
161
  end
167
162
 
168
163
  def to_text
@@ -249,12 +244,12 @@ module CollectiveIdea #:nodoc:
249
244
 
250
245
  # Decrease the counter for all old parents
251
246
  if old_parent = self.parent
252
- self.class.decrement_counter(acts_as_nested_set_options[:counter_cache], old_parent)
247
+ old_parent.class.decrement_counter(acts_as_nested_set_options[:counter_cache], old_parent)
253
248
  end
254
249
 
255
250
  # Increase the counter for all new parents
256
251
  if new_parent = self.reload.parent
257
- self.class.increment_counter(acts_as_nested_set_options[:counter_cache], new_parent)
252
+ new_parent.class.increment_counter(acts_as_nested_set_options[:counter_cache], new_parent)
258
253
  end
259
254
  end
260
255
 
@@ -96,7 +96,7 @@ module CollectiveIdea #:nodoc:
96
96
 
97
97
  def lock_nodes_between!(left_bound, right_bound)
98
98
  # select the rows in the model between a and d, and apply a lock
99
- instance_base_class.nested_set_scope.
99
+ instance_base_class.default_scoped.nested_set_scope.
100
100
  right_of(left_bound).left_of_right_side(right_bound).
101
101
  select(primary_column_name).
102
102
  lock(true)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AwesomeNestedSet
4
- VERSION = '3.3.1' unless defined?(::AwesomeNestedSet::VERSION)
4
+ VERSION = '3.4.0' unless defined?(::AwesomeNestedSet::VERSION)
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awesome_nested_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -36,7 +36,7 @@ cert_chain:
36
36
  Hsej0MQ3drCB1eA4c9OXdCUQJnY2aLTq3uNvTbZvoTgWK55eq3KLBJ4zzoKZ4tBX
37
37
  /HIFI/fEwYlI1Ji3oikUrHkc4rWgaQ==
38
38
  -----END CERTIFICATE-----
39
- date: 2021-01-04 00:00:00.000000000 Z
39
+ date: 2021-02-22 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activerecord
@@ -154,14 +154,14 @@ dependencies:
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: 3.8.0
157
+ version: 4.0.0
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
- version: 3.8.0
164
+ version: 4.0.0
165
165
  description: An awesome nested set implementation for Active Record
166
166
  email: info@collectiveidea.com
167
167
  executables: []
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  - !ruby/object:Gem::Version
212
212
  version: '0'
213
213
  requirements: []
214
- rubygems_version: 3.2.3
214
+ rubygems_version: 3.1.4
215
215
  signing_key:
216
216
  specification_version: 4
217
217
  summary: An awesome nested set implementation for Active Record
metadata.gz.sig CHANGED
Binary file