acts_as_recursive_tree 2.2.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +37 -0
  3. data/.github/workflows/lint.yml +31 -0
  4. data/.github/workflows/rubygem.yml +37 -0
  5. data/.gitignore +2 -1
  6. data/.rubocop.yml +30 -1
  7. data/.rubocop_todo.yml +28 -281
  8. data/Appraisals +10 -20
  9. data/CHANGELOG.md +10 -1
  10. data/Gemfile +2 -0
  11. data/README.md +3 -0
  12. data/Rakefile +8 -8
  13. data/acts_as_recursive_tree.gemspec +27 -18
  14. data/gemfiles/ar_52.gemfile +8 -0
  15. data/gemfiles/ar_60.gemfile +8 -0
  16. data/gemfiles/ar_61.gemfile +8 -0
  17. data/lib/acts_as_recursive_tree.rb +7 -11
  18. data/lib/acts_as_recursive_tree/acts_macro.rb +6 -6
  19. data/lib/acts_as_recursive_tree/associations.rb +10 -8
  20. data/lib/acts_as_recursive_tree/builders/ancestors.rb +3 -2
  21. data/lib/acts_as_recursive_tree/builders/descendants.rb +3 -1
  22. data/lib/acts_as_recursive_tree/builders/leaves.rb +7 -8
  23. data/lib/acts_as_recursive_tree/builders/relation_builder.rb +14 -10
  24. data/lib/acts_as_recursive_tree/builders/{strategy.rb → strategies.rb} +3 -9
  25. data/lib/acts_as_recursive_tree/builders/{strategy → strategies}/ancestor.rb +3 -1
  26. data/lib/acts_as_recursive_tree/builders/{strategy → strategies}/descendant.rb +3 -1
  27. data/lib/acts_as_recursive_tree/builders/{strategy → strategies}/join.rb +5 -3
  28. data/lib/acts_as_recursive_tree/builders/{strategy → strategies}/subselect.rb +3 -1
  29. data/lib/acts_as_recursive_tree/config.rb +2 -0
  30. data/lib/acts_as_recursive_tree/model.rb +9 -8
  31. data/lib/acts_as_recursive_tree/options/depth_condition.rb +3 -2
  32. data/lib/acts_as_recursive_tree/options/query_options.rb +4 -2
  33. data/lib/acts_as_recursive_tree/options/values.rb +17 -19
  34. data/lib/acts_as_recursive_tree/railtie.rb +2 -0
  35. data/lib/acts_as_recursive_tree/scopes.rb +8 -4
  36. data/lib/acts_as_recursive_tree/version.rb +3 -1
  37. data/spec/builders_spec.rb +17 -11
  38. data/spec/db/database.rb +5 -4
  39. data/spec/db/database.yml +2 -5
  40. data/spec/db/models.rb +12 -11
  41. data/spec/db/schema.rb +3 -4
  42. data/spec/model/location_spec.rb +7 -11
  43. data/spec/model/node_spec.rb +35 -49
  44. data/spec/model/relation_spec.rb +6 -11
  45. data/spec/spec_helper.rb +54 -55
  46. data/spec/values_spec.rb +21 -17
  47. metadata +115 -33
  48. data/lib/acts_as_recursive_tree/builders.rb +0 -14
  49. data/lib/acts_as_recursive_tree/options.rb +0 -9
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_recursive_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolfgang Wedelich-John
8
8
  - Willem Mulder
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-30 00:00:00.000000000 Z
12
+ date: 2021-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,20 +17,68 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 5.0.0
20
+ version: 5.2.0
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: 6.2.0
23
+ version: '7.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 5.0.0
30
+ version: 5.2.0
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: 6.2.0
33
+ version: '7.0'
34
+ - !ruby/object:Gem::Dependency
35
+ name: activesupport
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 5.2.0
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '7.0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 5.2.0
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '7.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: zeitwerk
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '2.4'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '2.4'
68
+ - !ruby/object:Gem::Dependency
69
+ name: appraisal
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.4'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.4'
34
82
  - !ruby/object:Gem::Dependency
35
83
  name: database_cleaner
36
84
  requirement: !ruby/object:Gem::Requirement
@@ -49,68 +97,99 @@ dependencies:
49
97
  name: rake
50
98
  requirement: !ruby/object:Gem::Requirement
51
99
  requirements:
52
- - - "~>"
100
+ - - ">="
53
101
  - !ruby/object:Gem::Version
54
- version: '10.0'
102
+ version: '0'
55
103
  type: :development
56
104
  prerelease: false
57
105
  version_requirements: !ruby/object:Gem::Requirement
58
106
  requirements:
59
- - - "~>"
107
+ - - ">="
60
108
  - !ruby/object:Gem::Version
61
- version: '10.0'
109
+ version: '0'
62
110
  - !ruby/object:Gem::Dependency
63
111
  name: rspec-rails
64
112
  requirement: !ruby/object:Gem::Requirement
65
113
  requirements:
66
- - - "~>"
114
+ - - ">="
67
115
  - !ruby/object:Gem::Version
68
116
  version: '3.5'
69
117
  type: :development
70
118
  prerelease: false
71
119
  version_requirements: !ruby/object:Gem::Requirement
72
120
  requirements:
73
- - - "~>"
121
+ - - ">="
74
122
  - !ruby/object:Gem::Version
75
123
  version: '3.5'
76
124
  - !ruby/object:Gem::Dependency
77
- name: sqlite3
125
+ name: rubocop
78
126
  requirement: !ruby/object:Gem::Requirement
79
127
  requirements:
80
- - - "~>"
128
+ - - ">="
81
129
  - !ruby/object:Gem::Version
82
- version: '1.3'
130
+ version: 1.8.0
83
131
  type: :development
84
132
  prerelease: false
85
133
  version_requirements: !ruby/object:Gem::Requirement
86
134
  requirements:
87
- - - "~>"
135
+ - - ">="
88
136
  - !ruby/object:Gem::Version
89
- version: '1.3'
137
+ version: 1.8.0
90
138
  - !ruby/object:Gem::Dependency
91
- name: appraisal
139
+ name: rubocop-rails
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 2.9.0
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: 2.9.0
152
+ - !ruby/object:Gem::Dependency
153
+ name: rubocop-rspec
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: 2.1.0
159
+ type: :development
160
+ prerelease: false
161
+ version_requirements: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: 2.1.0
166
+ - !ruby/object:Gem::Dependency
167
+ name: sqlite3
92
168
  requirement: !ruby/object:Gem::Requirement
93
169
  requirements:
94
170
  - - "~>"
95
171
  - !ruby/object:Gem::Version
96
- version: '2.4'
172
+ version: '1.3'
97
173
  type: :development
98
174
  prerelease: false
99
175
  version_requirements: !ruby/object:Gem::Requirement
100
176
  requirements:
101
177
  - - "~>"
102
178
  - !ruby/object:Gem::Version
103
- version: '2.4'
179
+ version: '1.3'
104
180
  description: "\n This is a ruby gem that provides drop in replacement for acts_as_tree
105
181
  but makes use of SQL recursive statement. Be sure to have a DBMS that supports recursive
106
182
  queries when using this gem (e.g. PostgreSQL or SQLite). "
107
183
  email:
108
- - wolfgang.wedelich@1und1.de
184
+ - wolfgang.wedelich@ionos.com
109
185
  - 14mRh4X0r@gmail.com
110
186
  executables: []
111
187
  extensions: []
112
188
  extra_rdoc_files: []
113
189
  files:
190
+ - ".github/workflows/ci.yml"
191
+ - ".github/workflows/lint.yml"
192
+ - ".github/workflows/rubygem.yml"
114
193
  - ".gitignore"
115
194
  - ".rspec"
116
195
  - ".rubocop.yml"
@@ -122,22 +201,23 @@ files:
122
201
  - README.md
123
202
  - Rakefile
124
203
  - acts_as_recursive_tree.gemspec
204
+ - gemfiles/ar_52.gemfile
205
+ - gemfiles/ar_60.gemfile
206
+ - gemfiles/ar_61.gemfile
125
207
  - lib/acts_as_recursive_tree.rb
126
208
  - lib/acts_as_recursive_tree/acts_macro.rb
127
209
  - lib/acts_as_recursive_tree/associations.rb
128
- - lib/acts_as_recursive_tree/builders.rb
129
210
  - lib/acts_as_recursive_tree/builders/ancestors.rb
130
211
  - lib/acts_as_recursive_tree/builders/descendants.rb
131
212
  - lib/acts_as_recursive_tree/builders/leaves.rb
132
213
  - lib/acts_as_recursive_tree/builders/relation_builder.rb
133
- - lib/acts_as_recursive_tree/builders/strategy.rb
134
- - lib/acts_as_recursive_tree/builders/strategy/ancestor.rb
135
- - lib/acts_as_recursive_tree/builders/strategy/descendant.rb
136
- - lib/acts_as_recursive_tree/builders/strategy/join.rb
137
- - lib/acts_as_recursive_tree/builders/strategy/subselect.rb
214
+ - lib/acts_as_recursive_tree/builders/strategies.rb
215
+ - lib/acts_as_recursive_tree/builders/strategies/ancestor.rb
216
+ - lib/acts_as_recursive_tree/builders/strategies/descendant.rb
217
+ - lib/acts_as_recursive_tree/builders/strategies/join.rb
218
+ - lib/acts_as_recursive_tree/builders/strategies/subselect.rb
138
219
  - lib/acts_as_recursive_tree/config.rb
139
220
  - lib/acts_as_recursive_tree/model.rb
140
- - lib/acts_as_recursive_tree/options.rb
141
221
  - lib/acts_as_recursive_tree/options/depth_condition.rb
142
222
  - lib/acts_as_recursive_tree/options/query_options.rb
143
223
  - lib/acts_as_recursive_tree/options/values.rb
@@ -157,8 +237,10 @@ files:
157
237
  homepage: https://github.com/1and1/acts_as_recursive_tree
158
238
  licenses:
159
239
  - MIT
160
- metadata: {}
161
- post_install_message:
240
+ metadata:
241
+ bug_tracker_uri: https://github.com/1and1/acts_as_recursive_tree/issues
242
+ changelog_uri: https://github.com/1and1/acts_as_recursive_tree/CHANGELOG.md
243
+ post_install_message:
162
244
  rdoc_options: []
163
245
  require_paths:
164
246
  - lib
@@ -166,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
248
  requirements:
167
249
  - - ">="
168
250
  - !ruby/object:Gem::Version
169
- version: 2.0.0
251
+ version: 2.5.0
170
252
  required_rubygems_version: !ruby/object:Gem::Requirement
171
253
  requirements:
172
254
  - - ">="
@@ -174,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
256
  version: '0'
175
257
  requirements: []
176
258
  rubygems_version: 3.1.6
177
- signing_key:
259
+ signing_key:
178
260
  specification_version: 4
179
261
  summary: Drop in replacement for acts_as_tree but using recursive queries
180
262
  test_files:
@@ -1,14 +0,0 @@
1
- module ActsAsRecursiveTree
2
- module Builders
3
- extend ActiveSupport::Autoload
4
-
5
- autoload :Values
6
- autoload :DepthCondition
7
- autoload :QueryOptions
8
- autoload :Strategy
9
- autoload :RelationBuilder
10
- autoload :Descendants
11
- autoload :Ancestors
12
- autoload :Leaves
13
- end
14
- end
@@ -1,9 +0,0 @@
1
- module ActsAsRecursiveTree
2
- module Options
3
- extend ActiveSupport::Autoload
4
-
5
- autoload :Values
6
- autoload :DepthCondition
7
- autoload :QueryOptions
8
- end
9
- end