acts_as_recursive_tree 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa1a901a4881db96a5aff4515cb0fe5f5b52d8713c7277aa67b4c5e3ffba70d4
4
- data.tar.gz: 5201f9c51c39a944b2fcb7e8abafe24d07722870f2545cf0cfb1116a46567238
3
+ metadata.gz: 1f081d3db44eb5e8048b41f4117163982098cbf0da278245e21a9c3c72cf9524
4
+ data.tar.gz: ad000b2858a04df23fa3e50a4cb103a5c365f1387dd731b37e204cb3cce5fa48
5
5
  SHA512:
6
- metadata.gz: '028d295a1d44a545798862a602448f635dd854bc63373d654ebaa217b41d8fded8327d6c10d0d64a566d7fd96beef3430261f66a135bdb1d7484cbcd25d3cae7'
7
- data.tar.gz: 0a0746c45165e981ef5965bb751d5bfc88ac8ffdb07edc898799b4fa781a2f302d12c57b4ee2582e41c8b5c439d9c50b0019aa60f0b21a270f8388911dcc1939
6
+ metadata.gz: c38a516a86f307e94be69e10808ced5692e5894e1e1502c7ab492d49439d32fdcf365b419b31a4cf9c636af1859da59f401c8fb3e4d9e9f6d875642405d7843e
7
+ data.tar.gz: 544488083842293d361e9f0c51b9553c856130bac0f21b3ece4e1316314d74c3474dfc4466c9fdb1fd7f78084b2746297fafd639c30250fc22ec928715d3cf2c
@@ -1,3 +1,6 @@
1
+ ### Version 2.2.0
2
+ - Rails 6.0 support
3
+
1
4
  ### Version 2.1.1
2
5
  - Enabled subselect query when using depth
3
6
  - new QueryOption query_strategy for forcing a specific strategy (:join, :subselect)
@@ -20,9 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^spec/})
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'activerecord', '>= 5.0.0', '< 6.0.0'
23
+ spec.add_runtime_dependency 'activerecord', '>= 5.0.0', '< 6.1.0'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.7'
26
25
  spec.add_development_dependency 'database_cleaner', '~> 1.5'
27
26
  spec.add_development_dependency 'rake', '~> 10.0'
28
27
  spec.add_development_dependency 'rspec-rails', '~> 3.5'
@@ -1,3 +1,3 @@
1
1
  module ActsAsRecursiveTree
2
- VERSION = '2.1.1'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
@@ -20,12 +20,14 @@ end
20
20
 
21
21
  shared_examples 'basic recursive examples' do
22
22
  it { is_expected.to start_with "SELECT \"#{model_class.table_name}\".* FROM \"#{model_class.table_name}\"" }
23
+
23
24
  it { is_expected.to match /WHERE "#{model_class.table_name}"."#{model_class.primary_key}" = #{model_id}/ }
25
+
24
26
  it { is_expected.to match /WITH RECURSIVE "#{builder.travers_loc_table.name}" AS/ }
27
+
25
28
  it { is_expected.to match /SELECT "#{model_class.table_name}"."#{model_class.primary_key}", "#{model_class.table_name}"."#{model_class._recursive_tree_config.parent_key}", 0 AS recursive_depth FROM "#{model_class.table_name}"/ }
29
+
26
30
  it { is_expected.to match /SELECT "#{model_class.table_name}"."#{model_class.primary_key}", "#{model_class.table_name}"."#{model_class._recursive_tree_config.parent_key}", \("#{builder.travers_loc_table.name}"."recursive_depth" \+ 1\) AS recursive_depth FROM "#{model_class.table_name}"/ }
27
- it { is_expected.to match /#{Regexp.escape(builder.travers_loc_table.project(Arel.star).to_sql)}/ }
28
- it { is_expected.to match /"#{model_class.table_name}"."#{model_class.primary_key}" = "#{builder.recursive_temp_table.name}"."#{model_class.primary_key}"/ }
29
31
  end
30
32
 
31
33
  shared_examples 'build recursive query' do
@@ -70,6 +72,7 @@ shared_examples 'descendant query' do
70
72
  include_context 'base_setup'
71
73
 
72
74
  it { is_expected.to match /"#{model_class.table_name}"."#{model_class._recursive_tree_config.parent_key}" = "#{builder.travers_loc_table.name}"."#{model_class.primary_key}"/ }
75
+ it { is_expected.to match /#{Regexp.escape(builder.travers_loc_table.project(builder.travers_loc_table[model_class.primary_key]).to_sql)}/ }
73
76
  end
74
77
 
75
78
  shared_context 'context with ordering' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_recursive_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolfgang Wedelich-John
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 5.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 6.0.0
22
+ version: 6.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,21 +29,7 @@ dependencies:
29
29
  version: 5.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 6.0.0
33
- - !ruby/object:Gem::Dependency
34
- name: bundler
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.7'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.7'
32
+ version: 6.1.0
47
33
  - !ruby/object:Gem::Dependency
48
34
  name: database_cleaner
49
35
  requirement: !ruby/object:Gem::Requirement
@@ -170,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
156
  - !ruby/object:Gem::Version
171
157
  version: '0'
172
158
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.7.6
159
+ rubygems_version: 3.0.6
175
160
  signing_key:
176
161
  specification_version: 4
177
162
  summary: Drop in replacement for acts_as_tree but using recursive queries