awesome_nested_set 3.4.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +10 -2
- data/README.md +9 -12
- data/lib/awesome_nested_set/awesome_nested_set.rb +1 -1
- data/lib/awesome_nested_set/helper.rb +2 -2
- data/lib/awesome_nested_set/model/prunable.rb +7 -2
- data/lib/awesome_nested_set/model.rb +1 -1
- data/lib/awesome_nested_set/move.rb +3 -1
- data/lib/awesome_nested_set/version.rb +1 -1
- metadata +9 -55
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c26151d6850942daadf3035ba6cbb20399efbe348ae4522cf897bb319e6f0de
|
4
|
+
data.tar.gz: 667d9b0cbd91b90b7b7e8075481ba400c4ecbbd344b204908b2301d2daf690d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38de65793aacc7b68c542b16018a36bcfa9d65af9158d4126bc4ff25c0759531f8b9af605b2bf31894097935be97c15c6eee7ae72616ab56c6388844138558a3
|
7
|
+
data.tar.gz: 319065889f794e1eec94cb8b1e0113dce515da6430401a20910479e1dd763bce238a31ae36cd957f690564bd42458877367b2dd45c3dbe2c2689c2ae550187df
|
data/CHANGELOG
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
Unreleased version
|
2
2
|
|
3
|
-
|
3
|
+
3.6.0
|
4
|
+
* Support Rails 7.1 [Harshal Bhakta](https://github.com/harshalbhakta)
|
5
|
+
* Improve ImpossibleMove error message [AlejandroFernandesAntunes](https://github.com/AlejandroFernandesAntunes)
|
6
|
+
|
7
|
+
3.5.0
|
8
|
+
* Support Rails 7.0.0 [Peter Berkenbosch](https://github.com/peterberkenbosch) and [Andrew Hampton](https://github.com/andrewhampton)
|
9
|
+
* Make `order_column` option more flexible by removing explicit `=> :asc` [Regis Millet](https://github.com/Kulgar)
|
10
|
+
* Updated README to use latest migration syntax [Justin MacCarthy](https://github.com/macarthy)
|
11
|
+
* [Compare to 3.4.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...v3.5.0)
|
4
12
|
|
5
13
|
3.4.0
|
6
14
|
* Keep current scope when calling `roots` [Petrik de Heus](https://github.com/p8)
|
7
15
|
* 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...
|
16
|
+
* [Compare to 3.3.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...v3.4.0)
|
9
17
|
|
10
18
|
3.3.1
|
11
19
|
* Add belongs_to :polymorphic key option only when used [Filippo Liverani](https://github.com/filippoliverani)
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# Awesome Nested Set
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![CI](https://github.com/collectiveidea/awesome_nested_set/actions/workflows/ci.yml/badge.svg)](https://github.com/collectiveidea/awesome_nested_set/actions/workflows/ci.yml) [![Code Climate](https://codeclimate.com/github/collectiveidea/awesome_nested_set.svg)](https://codeclimate.com/github/collectiveidea/awesome_nested_set)
|
4
4
|
|
5
5
|
|
6
6
|
Awesome Nested Set is an implementation of the nested set pattern for ActiveRecord models.
|
7
7
|
It is a replacement for acts_as_nested_set and BetterNestedSet, but more awesome.
|
8
8
|
|
9
|
-
Version 3.2 supports Rails 6, 3.1 supports Rails 5 & 4. Version 2 supports Rails 3.
|
9
|
+
Older versions: Version 3.2 supports Rails 6, 3.1 supports Rails 5 & 4. Version 2 supports Rails 3.
|
10
10
|
Gem versions prior to 2.0 support Rails 2.
|
11
11
|
|
12
12
|
## What makes this so awesome?
|
@@ -32,22 +32,19 @@ function properly.
|
|
32
32
|
|
33
33
|
```ruby
|
34
34
|
class CreateCategories < ActiveRecord::Migration
|
35
|
-
def
|
35
|
+
def change
|
36
36
|
create_table :categories do |t|
|
37
37
|
t.string :name
|
38
|
-
t.integer :parent_id, :
|
39
|
-
t.integer :lft, :
|
40
|
-
t.integer :rgt, :
|
38
|
+
t.integer :parent_id, null: true, index: true
|
39
|
+
t.integer :lft, null: false, index: true
|
40
|
+
t.integer :rgt, null: false, index: true
|
41
41
|
|
42
42
|
# optional fields
|
43
|
-
t.integer :depth, :
|
44
|
-
t.integer :children_count, :
|
43
|
+
t.integer :depth, null: false, default: 0
|
44
|
+
t.integer :children_count, null: false, default: 0
|
45
|
+
t.timestamps
|
45
46
|
end
|
46
47
|
end
|
47
|
-
|
48
|
-
def self.down
|
49
|
-
drop_table :categories
|
50
|
-
end
|
51
48
|
end
|
52
49
|
```
|
53
50
|
|
@@ -12,8 +12,8 @@ module CollectiveIdea #:nodoc:
|
|
12
12
|
#
|
13
13
|
# == Params
|
14
14
|
# * +class_or_item+ - Class name or top level times
|
15
|
-
# * +mover+ - The item that is being move, used to
|
16
|
-
# * +&block+ - a block that will be used to display: {
|
15
|
+
# * +mover+ - The item that is being move, used to exclude impossible moves
|
16
|
+
# * +&block+ - a block that will be used to display: { |item| ... item.name }
|
17
17
|
#
|
18
18
|
# == Usage
|
19
19
|
#
|
@@ -47,8 +47,13 @@ module CollectiveIdea #:nodoc:
|
|
47
47
|
elsif acts_as_nested_set_options[:dependent] == :restrict_with_error
|
48
48
|
unless leaf?
|
49
49
|
record = self.class.human_attribute_name(:children).downcase
|
50
|
-
|
51
|
-
|
50
|
+
if Rails::VERSION::MAJOR < 5
|
51
|
+
errors.add(:base, :"restrict_dependent_destroy.many", record: record)
|
52
|
+
return false
|
53
|
+
else
|
54
|
+
errors.add(:base, :"restrict_dependent_destroy.has_many", record: record)
|
55
|
+
throw :abort
|
56
|
+
end
|
52
57
|
end
|
53
58
|
return true
|
54
59
|
elsif acts_as_nested_set_options[:dependent] == :nullify
|
@@ -129,7 +129,9 @@ module CollectiveIdea #:nodoc:
|
|
129
129
|
|
130
130
|
def prevent_impossible_move
|
131
131
|
if !root && !instance.move_possible?(target)
|
132
|
-
|
132
|
+
error_msg = "Impossible move, target node (#{target.class.name},ID: #{target.id})
|
133
|
+
cannot be inside moved tree (#{instance.class.name},ID: #{instance.id})."
|
134
|
+
raise ImpossibleMove, error_msg
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
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.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -9,34 +9,8 @@ authors:
|
|
9
9
|
- Philip Arndt
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
|
-
cert_chain:
|
13
|
-
-
|
14
|
-
-----BEGIN CERTIFICATE-----
|
15
|
-
MIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z
|
16
|
-
L0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjAwNTEwMjIxOTQ2WhcNMjEwNTEwMjIx
|
17
|
-
OTQ2WjAjMSEwHwYDVQQDDBhnZW1zL0RDPXAvREM9YXJuZHQvREM9aW8wggGiMA0G
|
18
|
-
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDT+JzHYPGMYJt9ct2DCsbIymn1uJJp
|
19
|
-
HnDkQESfsGe40jTC90oF2iVbVOkaacNc1N3CSWUZvZjuygUuS86P6/kpBILGdO2+
|
20
|
-
bkXXKtfGC2YGGx9TdNLpCb4925vQHvdFeKXGpQDZdDw1SNC6zraZou47CvOE1cl2
|
21
|
-
Bp+1QMZuGRZ4+5CzOEWDWurjqce3O1jUEbyBB7z5H0h/YEaxfXipxhL1Dhi0sgkH
|
22
|
-
qP/e6SxzifdifdZCksJ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4zzoKZ4tBX
|
37
|
-
/HIFI/fEwYlI1Ji3oikUrHkc4rWgaQ==
|
38
|
-
-----END CERTIFICATE-----
|
39
|
-
date: 2021-02-22 00:00:00.000000000 Z
|
12
|
+
cert_chain: []
|
13
|
+
date: 2023-10-05 00:00:00.000000000 Z
|
40
14
|
dependencies:
|
41
15
|
- !ruby/object:Gem::Dependency
|
42
16
|
name: activerecord
|
@@ -47,7 +21,7 @@ dependencies:
|
|
47
21
|
version: 4.0.0
|
48
22
|
- - "<"
|
49
23
|
- !ruby/object:Gem::Version
|
50
|
-
version: '7.
|
24
|
+
version: '7.2'
|
51
25
|
type: :runtime
|
52
26
|
prerelease: false
|
53
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +31,7 @@ dependencies:
|
|
57
31
|
version: 4.0.0
|
58
32
|
- - "<"
|
59
33
|
- !ruby/object:Gem::Version
|
60
|
-
version: '7.
|
34
|
+
version: '7.2'
|
61
35
|
- !ruby/object:Gem::Dependency
|
62
36
|
name: appraisal
|
63
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,26 +46,6 @@ dependencies:
|
|
72
46
|
- - ">="
|
73
47
|
- !ruby/object:Gem::Version
|
74
48
|
version: '0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: combustion
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: 0.5.2
|
82
|
-
- - "<"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 0.5.5
|
85
|
-
type: :development
|
86
|
-
prerelease: false
|
87
|
-
version_requirements: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: 0.5.2
|
92
|
-
- - "<"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: 0.5.5
|
95
49
|
- !ruby/object:Gem::Dependency
|
96
50
|
name: database_cleaner
|
97
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,14 +94,14 @@ dependencies:
|
|
140
94
|
requirements:
|
141
95
|
- - "~>"
|
142
96
|
- !ruby/object:Gem::Version
|
143
|
-
version: '
|
97
|
+
version: '13'
|
144
98
|
type: :development
|
145
99
|
prerelease: false
|
146
100
|
version_requirements: !ruby/object:Gem::Requirement
|
147
101
|
requirements:
|
148
102
|
- - "~>"
|
149
103
|
- !ruby/object:Gem::Version
|
150
|
-
version: '
|
104
|
+
version: '13'
|
151
105
|
- !ruby/object:Gem::Dependency
|
152
106
|
name: rspec-rails
|
153
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,7 +142,7 @@ files:
|
|
188
142
|
- lib/awesome_nested_set/set_validator.rb
|
189
143
|
- lib/awesome_nested_set/tree.rb
|
190
144
|
- lib/awesome_nested_set/version.rb
|
191
|
-
homepage:
|
145
|
+
homepage: https://github.com/collectiveidea/awesome_nested_set
|
192
146
|
licenses:
|
193
147
|
- MIT
|
194
148
|
metadata: {}
|
@@ -211,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
165
|
- !ruby/object:Gem::Version
|
212
166
|
version: '0'
|
213
167
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
168
|
+
rubygems_version: 3.4.13
|
215
169
|
signing_key:
|
216
170
|
specification_version: 4
|
217
171
|
summary: An awesome nested set implementation for Active Record
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED