acts_as_recursive_tree 4.0.0 → 4.1.1

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: d14ef108322971d8058356f6103d0d64cfd53b33841c54e0cca6914907a2660b
4
- data.tar.gz: 8d2f856d9809597d4cec4fa307477f48050ae8c77a8e9d8678a73b590a9ac531
3
+ metadata.gz: 8b31870a0f7ae0f4ced9817639c863e4b0bdabbed1852a9c98320f71982ba983
4
+ data.tar.gz: ee8f1bdf68fb094004d2ed7c296efa9219decb62848623fdb0e9e73f2597f11d
5
5
  SHA512:
6
- metadata.gz: c7cd33f746eb9d0fe7cc6f9df17e365ec1f4d21b1369dae80b44322b854403e2ff5d6759cf645b6baa0d609670d922d26c0ba263ca9f34e6ba0c252a8daee926
7
- data.tar.gz: d064d90e580fabf8367dba2a60626197723d8938c4514f5e90f99541f62672d82885ae361a1acc1a486905a422f64f3f558fa420dd2d2d38e881e914b6ee9281
6
+ metadata.gz: 1f0fc7026dbcfe605c22d31633626135abbe72da80ba80c3a7c051b3565047551e1eebff2a01b8596ffc68fd18029b8724d1fb0cf697cf81a8039e182125e169
7
+ data.tar.gz: 9ef0f7c2f1007a92592f585daa798b7629c88540b44b58b51eaa5aca11a2e1ae9d2096ea9f9c28757c12099757622ffa476ff31026e955066023d3c8fe1cafd1
@@ -19,11 +19,17 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['3.1', '3.2', '3.3']
23
- gemfile: [ar_70, ar_71, ar_72, ar_next]
24
- # exclude:
25
- # - ruby-version: '3.2'
26
- # gemfile: ar_60
22
+ ruby-version: ['3.1', '3.2', '3.3', '3.4', '4.0']
23
+ gemfile: [ar_70, ar_71, ar_72, ar_80, ar_81, ar_next]
24
+ exclude:
25
+ - ruby-version: '3.1'
26
+ gemfile: ar_80
27
+ - ruby-version: '3.1'
28
+ gemfile: ar_81
29
+ - ruby-version: '3.1'
30
+ gemfile: ar_next
31
+ - ruby-version: '3.2'
32
+ gemfile: ar_next
27
33
  env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
28
34
  BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
29
35
  steps:
data/.rubocop_todo.yml CHANGED
@@ -1,68 +1,39 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-08-02 08:58:28 UTC using RuboCop version 1.18.4.
3
+ # on 2026-06-26 10:41:32 UTC using RuboCop version 1.68.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 6
10
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
11
- # IgnoredMethods: refine
12
- Metrics/BlockLength:
13
- Max: 87
14
-
15
9
  # Offense count: 1
16
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
10
+ # Configuration parameters: CountComments, CountAsOne.
11
+ Metrics/ClassLength:
12
+ Max: 101
13
+
14
+ # Offense count: 2
15
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
17
16
  Metrics/MethodLength:
18
17
  Max: 15
19
18
 
20
- # Offense count: 18
21
- # Configuration parameters: Prefixes.
19
+ # Offense count: 2
20
+ # Configuration parameters: Prefixes, AllowedPatterns.
22
21
  # Prefixes: when, with, without
23
22
  RSpec/ContextWording:
24
23
  Exclude:
25
- - 'spec/builders_spec.rb'
26
24
  - 'spec/model/location_spec.rb'
27
25
  - 'spec/model/node_spec.rb'
28
- - 'spec/model/relation_spec.rb'
29
- - 'spec/values_spec.rb'
30
26
 
31
- # Offense count: 37
27
+ # Offense count: 30
32
28
  # Configuration parameters: AssignmentOnly.
33
29
  RSpec/InstanceVariable:
34
30
  Exclude:
35
31
  - 'spec/model/location_spec.rb'
36
32
  - 'spec/model/node_spec.rb'
37
- - 'spec/model/relation_spec.rb'
38
-
39
- # Offense count: 1
40
- RSpec/MultipleDescribes:
41
- Exclude:
42
- - 'spec/builders_spec.rb'
43
-
44
- # Offense count: 2
45
- RSpec/MultipleExpectations:
46
- Max: 2
47
-
48
- # Offense count: 17
49
- # Configuration parameters: AllowedConstants.
50
- Style/Documentation:
51
- Exclude:
52
- - 'lib/acts_as_recursive_tree.rb'
53
- - 'lib/acts_as_recursive_tree/acts_macro.rb'
54
- - 'lib/acts_as_recursive_tree/builders/ancestors.rb'
55
- - 'lib/acts_as_recursive_tree/builders/descendants.rb'
56
- - 'lib/acts_as_recursive_tree/builders/leaves.rb'
57
- - 'lib/acts_as_recursive_tree/model.rb'
58
- - 'lib/acts_as_recursive_tree/options/depth_condition.rb'
59
- - 'lib/acts_as_recursive_tree/options/query_options.rb'
60
- - 'lib/acts_as_recursive_tree/options/values.rb'
61
- - 'lib/acts_as_recursive_tree/railtie.rb'
62
33
 
63
- # Offense count: 9
64
- # Cop supports --auto-correct.
65
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
34
+ # Offense count: 7
35
+ # This cop supports safe autocorrection (--autocorrect).
36
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
66
37
  # URISchemes: http, https
67
38
  Layout/LineLength:
68
39
  Max: 291
data/Appraisals CHANGED
@@ -15,6 +15,16 @@ appraise 'ar-72' do
15
15
  gem 'activesupport', '~> 7.2'
16
16
  end
17
17
 
18
+ appraise 'ar-80' do
19
+ gem 'activerecord', '~> 8.0'
20
+ gem 'activesupport', '~> 8.0'
21
+ end
22
+
23
+ appraise 'ar-81' do
24
+ gem 'activerecord', '~> 8.1'
25
+ gem 'activesupport', '~> 8.1'
26
+ end
27
+
18
28
  appraise 'ar-next' do
19
29
  git 'https://github.com/rails/rails.git', branch: 'main' do
20
30
  gem 'activerecord'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### Version 4.1.1
2
+ - ADD: Future support for change in Rails 8.2
3
+
4
+ ### Version 4.1.0
5
+ - ADD: Support for Rails 8.0
6
+
1
7
  ### Version 4.0.0
2
8
  - ADD: Support for Rails 7.2
3
9
  - BREAKING: Dropped support for Rails < 7
data/README.md CHANGED
@@ -17,6 +17,8 @@ ActsAsRecursiveTree currently supports following ActiveRecord versions and is te
17
17
  * ActiveRecord 7.0.x
18
18
  * ActiveRecord 7.1.x
19
19
  * ActiveRecord 7.2.x
20
+ * ActiveRecord 8.0.x
21
+ * ActiveRecord 8.1.x
20
22
  * ActiveRecord NEXT (from git)
21
23
 
22
24
  ## Supported Rubies
@@ -24,6 +26,8 @@ ActsAsRecursiveTree is tested with following rubies:
24
26
  * MRuby 3.1
25
27
  * MRuby 3.2
26
28
  * MRuby 3.3
29
+ * MRuby 3.4
30
+ * MRuby 4.0
27
31
 
28
32
  Other Ruby implementations are not tested, but should also work.
29
33
 
@@ -22,17 +22,17 @@ Gem::Specification.new do |spec|
22
22
  spec.files = `git ls-files -z`.split("\x0")
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'activerecord', '>= 7.0.0', '< 8'
26
- spec.add_dependency 'activesupport', '>= 7.0.0', '< 8'
25
+ spec.add_dependency 'activerecord', '>= 7.0.0', '< 9'
26
+ spec.add_dependency 'activesupport', '>= 7.0.0', '< 9'
27
27
  spec.add_dependency 'zeitwerk', '>= 2.4'
28
28
 
29
29
  spec.add_development_dependency 'appraisal', '~> 2.5'
30
30
  spec.add_development_dependency 'database_cleaner-active_record', '~> 2.2'
31
31
  spec.add_development_dependency 'rake'
32
- spec.add_development_dependency 'rspec-rails', '>= 6.1'
33
- spec.add_development_dependency 'rubocop', '~> 1.66.0'
34
- spec.add_development_dependency 'rubocop-rails', '~> 2.26.0'
35
- spec.add_development_dependency 'rubocop-rspec', '~> 3.0.4'
32
+ spec.add_development_dependency 'rspec-rails', '>= 7.1'
33
+ spec.add_development_dependency 'rubocop', '~> 1.68.0'
34
+ spec.add_development_dependency 'rubocop-rails', '~> 2.27.0'
35
+ spec.add_development_dependency 'rubocop-rspec', '~> 3.2.0'
36
36
 
37
37
  spec.add_development_dependency 'sqlite3', '~> 2.0'
38
38
  end
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 8.0"
6
+ gem "activesupport", "~> 8.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 8.1"
6
+ gem "activesupport", "~> 8.1"
7
+
8
+ gemspec path: "../"
@@ -32,11 +32,15 @@ module ActsAsRecursiveTree
32
32
  end
33
33
 
34
34
  def recursive_temp_table
35
- @recursive_temp_table ||= Arel::Table.new("recursive_#{klass.table_name}_#{@rand_int}_temp")
35
+ @recursive_temp_table ||= arel_table("recursive_#{klass.table_name}_#{@rand_int}_temp")
36
36
  end
37
37
 
38
38
  def travers_loc_table
39
- @travers_loc_table ||= Arel::Table.new("traverse_#{@rand_int}_loc")
39
+ @travers_loc_table ||= arel_table("traverse_#{@rand_int}_loc")
40
+ end
41
+
42
+ def arel_table(name)
43
+ config.arel_table_requires_keyword_args? ? Arel::Table.new(name: name) : Arel::Table.new(name)
40
44
  end
41
45
 
42
46
  def config
@@ -31,5 +31,11 @@ module ActsAsRecursiveTree
31
31
  @cycle_detection = @model_class.connection.adapter_name == 'PostgreSQL' &&
32
32
  @model_class.connection.database_version >= 140_000
33
33
  end
34
+
35
+ def arel_table_requires_keyword_args?
36
+ return @arel_table_requires_keyword_args if defined?(@arel_table_requires_keyword_args)
37
+
38
+ @arel_table_requires_keyword_args = ::ActiveRecord.version >= '8.2.0.alpha'
39
+ end
34
40
  end
35
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsRecursiveTree
4
- VERSION = '4.0.0'
4
+ VERSION = '4.1.1'
5
5
  end
@@ -17,7 +17,7 @@ RSpec.describe ActsAsRecursiveTree::Options::Values do
17
17
  end
18
18
  end
19
19
 
20
- let(:table) { Arel::Table.new('test_table') }
20
+ let(:table) { Location.arel_table }
21
21
  let(:attribute) { table['test_attr'] }
22
22
 
23
23
  context 'with invalid agurment' do
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: 4.0.0
4
+ version: 4.1.1
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: 2024-09-02 00:00:00.000000000 Z
12
+ date: 2026-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: 7.0.0
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '8'
23
+ version: '9'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: 7.0.0
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '8'
33
+ version: '9'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activesupport
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: 7.0.0
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '8'
43
+ version: '9'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: 7.0.0
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '8'
53
+ version: '9'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: zeitwerk
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -113,56 +113,56 @@ dependencies:
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '6.1'
116
+ version: '7.1'
117
117
  type: :development
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: '6.1'
123
+ version: '7.1'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rubocop
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: 1.66.0
130
+ version: 1.68.0
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 1.66.0
137
+ version: 1.68.0
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rubocop-rails
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 2.26.0
144
+ version: 2.27.0
145
145
  type: :development
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 2.26.0
151
+ version: 2.27.0
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: rubocop-rspec
154
154
  requirement: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 3.0.4
158
+ version: 3.2.0
159
159
  type: :development
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: 3.0.4
165
+ version: 3.2.0
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: sqlite3
168
168
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,8 @@ files:
204
204
  - gemfiles/ar_70.gemfile
205
205
  - gemfiles/ar_71.gemfile
206
206
  - gemfiles/ar_72.gemfile
207
+ - gemfiles/ar_80.gemfile
208
+ - gemfiles/ar_81.gemfile
207
209
  - gemfiles/ar_next.gemfile
208
210
  - lib/acts_as_recursive_tree.rb
209
211
  - lib/acts_as_recursive_tree/acts_macro.rb
@@ -247,7 +249,7 @@ licenses:
247
249
  metadata:
248
250
  bug_tracker_uri: https://github.com/1and1/acts_as_recursive_tree/issues
249
251
  changelog_uri: https://github.com/1and1/acts_as_recursive_tree/blob/main/CHANGELOG.md
250
- post_install_message:
252
+ post_install_message:
251
253
  rdoc_options: []
252
254
  require_paths:
253
255
  - lib
@@ -263,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
265
  version: '0'
264
266
  requirements: []
265
267
  rubygems_version: 3.3.27
266
- signing_key:
268
+ signing_key:
267
269
  specification_version: 4
268
270
  summary: Drop in replacement for acts_as_tree but using recursive queries
269
271
  test_files: []