hierarchable 0.4.0 → 0.4.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: 3d6c20331d20192fa3dbd557f89b3fd947d5a9f7211df39112c1522f80d894cb
4
- data.tar.gz: ce63a11cad576eb482b47b7e09a927a0c18b34b60d6f9e172e48de9d14d973f7
3
+ metadata.gz: 212394909f52a4008f0e9d3839863e5a994d12f2ce98b286a771f479fcd77eef
4
+ data.tar.gz: 1835a21af0559ddb4103cbff8719afe02e1993eca6d92d8b1c33d15fe59bc6bd
5
5
  SHA512:
6
- metadata.gz: a2af7ee7a1ca6922cd107be34b8f587ced4c74cfcfb2dd2bac1c74f203fca1ef47491b4404f6792c183305c2f3e9ed52c256b5ddbc9f27bda117abbe10cffae6
7
- data.tar.gz: a9e2fbb0427bf705cf2b402c16d57506d5e3533b30bae8590545aea2f5d618dc918cf113fe99db217575cad3c595186b95f404d6bf450db00c289cf20e81967e
6
+ metadata.gz: 0ec771edaa1e87e467d4322d96847fd055c32145ee5fe42a1d9b8c309d10ca30a4ff4b9aca43e2828edcfd927b71210495a8b65027cef80462bebb63cdaf1f52
7
+ data.tar.gz: f4196efc4b368e881e3e5607894e49b1b57ee901315001c37e45652a0d6936cde33841b5e9305fd48df52a3cd076f735b0b0e66aacf95314413f8500aef98d4a
data/.circleci/config.yml CHANGED
@@ -13,7 +13,7 @@ commands:
13
13
  - run:
14
14
  name: Set up bundler
15
15
  command: |
16
- gem install bundler:2.3.26
16
+ gem install bundler:2.6.9
17
17
  - run:
18
18
  name: Bundle Install
19
19
  command: |
@@ -46,7 +46,7 @@ jobs:
46
46
  resource_class: small
47
47
 
48
48
  docker:
49
- - image: cimg/ruby:3.2.2
49
+ - image: cimg/ruby:3.4.8
50
50
 
51
51
  steps:
52
52
  # --------- SETUP ---------
@@ -73,7 +73,7 @@ jobs:
73
73
  resource_class: small
74
74
 
75
75
  docker:
76
- - image: cimg/ruby:3.2.2
76
+ - image: cimg/ruby:3.4.8
77
77
 
78
78
  steps:
79
79
  # --------- SETUP ---------
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
8
+ - package-ecosystem: github-actions
9
+ directory: "/"
10
+ schedule:
11
+ interval: daily
12
+ open-pull-requests-limit: 10
data/.rubocop.yml CHANGED
@@ -1,8 +1,8 @@
1
- require:
2
- - 'rubocop-performance'
3
- - 'rubocop-rails'
4
- - 'rubocop-minitest'
5
- - 'rubocop-rake'
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rails
4
+ - rubocop-minitest
5
+ - rubocop-rake
6
6
 
7
7
  AllCops:
8
8
  NewCops: enable
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.2.2
1
+ ruby-3.4.8
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in hierarchable.gemspec
6
6
  gemspec
7
7
 
8
- gem 'bundler', '~> 2.3'
8
+ gem 'bundler', '~> 2.6'
9
9
  gem 'bundler-audit', '>= 0'
10
10
  gem 'minitest', '~> 5.0'
11
11
  gem 'rake', '~> 13.0'
@@ -15,5 +15,5 @@ gem 'rubocop-performance', '>= 0'
15
15
  gem 'rubocop-rails', '>= 0'
16
16
  gem 'rubocop-rake', '>= 0'
17
17
  gem 'ruby_audit', '>= 0'
18
- gem 'sqlite3', '>= 0'
18
+ gem 'sqlite3', '~> 2.0', '>= 2.0.2'
19
19
  gem 'temping', '~> 4.0'
data/Gemfile.lock CHANGED
@@ -1,108 +1,129 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hierarchable (0.4.0)
4
+ hierarchable (0.4.1)
5
5
  activerecord (> 4.2.0)
6
6
  activesupport (> 4.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (7.1.3.2)
12
- activesupport (= 7.1.3.2)
13
- activerecord (7.1.3.2)
14
- activemodel (= 7.1.3.2)
15
- activesupport (= 7.1.3.2)
11
+ activemodel (8.1.2)
12
+ activesupport (= 8.1.2)
13
+ activerecord (8.1.2)
14
+ activemodel (= 8.1.2)
15
+ activesupport (= 8.1.2)
16
16
  timeout (>= 0.4.0)
17
- activesupport (7.1.3.2)
17
+ activesupport (8.1.2)
18
18
  base64
19
19
  bigdecimal
20
- concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
21
  connection_pool (>= 2.2.5)
22
22
  drb
23
23
  i18n (>= 1.6, < 2)
24
+ json
25
+ logger (>= 1.4.2)
24
26
  minitest (>= 5.1)
25
- mutex_m
26
- tzinfo (~> 2.0)
27
- ast (2.4.2)
28
- base64 (0.2.0)
29
- bigdecimal (3.1.6)
30
- bundler-audit (0.9.1)
31
- bundler (>= 1.2.0, < 3)
27
+ securerandom (>= 0.3)
28
+ tzinfo (~> 2.0, >= 2.0.5)
29
+ uri (>= 0.13.1)
30
+ ast (2.4.3)
31
+ base64 (0.3.0)
32
+ bigdecimal (4.0.1)
33
+ bundler-audit (0.9.3)
34
+ bundler (>= 1.2.0)
32
35
  thor (~> 1.0)
33
- concurrent-ruby (1.2.3)
34
- connection_pool (2.4.1)
35
- drb (2.2.1)
36
- i18n (1.14.4)
36
+ concurrent-ruby (1.3.6)
37
+ connection_pool (3.0.2)
38
+ drb (2.2.3)
39
+ i18n (1.14.8)
37
40
  concurrent-ruby (~> 1.0)
38
- json (2.7.1)
39
- language_server-protocol (3.17.0.3)
40
- minitest (5.22.2)
41
- mutex_m (0.2.0)
42
- parallel (1.24.0)
43
- parser (3.3.0.5)
41
+ json (2.18.0)
42
+ language_server-protocol (3.17.0.5)
43
+ lint_roller (1.1.0)
44
+ logger (1.7.0)
45
+ minitest (5.27.0)
46
+ parallel (1.27.0)
47
+ parser (3.3.10.1)
44
48
  ast (~> 2.4.1)
45
49
  racc
46
- racc (1.7.3)
47
- rack (3.0.9.1)
50
+ prism (1.8.0)
51
+ racc (1.8.1)
52
+ rack (3.2.4)
48
53
  rainbow (3.1.1)
49
- rake (13.1.0)
50
- regexp_parser (2.9.0)
51
- rexml (3.2.6)
52
- rubocop (1.62.1)
54
+ rake (13.3.1)
55
+ regexp_parser (2.11.3)
56
+ rubocop (1.82.1)
53
57
  json (~> 2.3)
54
- language_server-protocol (>= 3.17.0)
58
+ language_server-protocol (~> 3.17.0.2)
59
+ lint_roller (~> 1.1.0)
55
60
  parallel (~> 1.10)
56
61
  parser (>= 3.3.0.2)
57
62
  rainbow (>= 2.2.2, < 4.0)
58
- regexp_parser (>= 1.8, < 3.0)
59
- rexml (>= 3.2.5, < 4.0)
60
- rubocop-ast (>= 1.31.1, < 2.0)
63
+ regexp_parser (>= 2.9.3, < 3.0)
64
+ rubocop-ast (>= 1.48.0, < 2.0)
61
65
  ruby-progressbar (~> 1.7)
62
- unicode-display_width (>= 2.4.0, < 3.0)
63
- rubocop-ast (1.31.2)
64
- parser (>= 3.3.0.4)
65
- rubocop-minitest (0.35.0)
66
- rubocop (>= 1.61, < 2.0)
67
- rubocop-ast (>= 1.31.1, < 2.0)
68
- rubocop-performance (1.20.2)
69
- rubocop (>= 1.48.1, < 2.0)
70
- rubocop-ast (>= 1.30.0, < 2.0)
71
- rubocop-rails (2.24.0)
66
+ unicode-display_width (>= 2.4.0, < 4.0)
67
+ rubocop-ast (1.49.0)
68
+ parser (>= 3.3.7.2)
69
+ prism (~> 1.7)
70
+ rubocop-minitest (0.38.2)
71
+ lint_roller (~> 1.1)
72
+ rubocop (>= 1.75.0, < 2.0)
73
+ rubocop-ast (>= 1.38.0, < 2.0)
74
+ rubocop-performance (1.26.1)
75
+ lint_roller (~> 1.1)
76
+ rubocop (>= 1.75.0, < 2.0)
77
+ rubocop-ast (>= 1.47.1, < 2.0)
78
+ rubocop-rails (2.34.3)
72
79
  activesupport (>= 4.2.0)
80
+ lint_roller (~> 1.1)
73
81
  rack (>= 1.1)
74
- rubocop (>= 1.33.0, < 2.0)
75
- rubocop-ast (>= 1.31.1, < 2.0)
76
- rubocop-rake (0.6.0)
77
- rubocop (~> 1.0)
82
+ rubocop (>= 1.75.0, < 2.0)
83
+ rubocop-ast (>= 1.44.0, < 2.0)
84
+ rubocop-rake (0.7.1)
85
+ lint_roller (~> 1.1)
86
+ rubocop (>= 1.72.1)
78
87
  ruby-progressbar (1.13.0)
79
- ruby_audit (2.3.0)
88
+ ruby_audit (3.1.0)
80
89
  bundler-audit (~> 0.9.0)
81
- sqlite3 (1.7.2-aarch64-linux)
82
- sqlite3 (1.7.2-arm-linux)
83
- sqlite3 (1.7.2-arm64-darwin)
84
- sqlite3 (1.7.2-x86-linux)
85
- sqlite3 (1.7.2-x86_64-darwin)
86
- sqlite3 (1.7.2-x86_64-linux)
87
- temping (4.1.1)
88
- activerecord (>= 6.0, < 7.2)
89
- activesupport (>= 6.0, < 7.2)
90
- thor (1.3.1)
91
- timeout (0.4.1)
90
+ securerandom (0.4.1)
91
+ sqlite3 (2.9.0-aarch64-linux-gnu)
92
+ sqlite3 (2.9.0-aarch64-linux-musl)
93
+ sqlite3 (2.9.0-arm-linux-gnu)
94
+ sqlite3 (2.9.0-arm-linux-musl)
95
+ sqlite3 (2.9.0-arm64-darwin)
96
+ sqlite3 (2.9.0-x86-linux-gnu)
97
+ sqlite3 (2.9.0-x86-linux-musl)
98
+ sqlite3 (2.9.0-x86_64-darwin)
99
+ sqlite3 (2.9.0-x86_64-linux-gnu)
100
+ sqlite3 (2.9.0-x86_64-linux-musl)
101
+ temping (4.4.0)
102
+ activerecord (>= 6.0, < 8.2)
103
+ activesupport (>= 6.0, < 8.2)
104
+ thor (1.5.0)
105
+ timeout (0.6.0)
92
106
  tzinfo (2.0.6)
93
107
  concurrent-ruby (~> 1.0)
94
- unicode-display_width (2.5.0)
108
+ unicode-display_width (3.2.0)
109
+ unicode-emoji (~> 4.1)
110
+ unicode-emoji (4.2.0)
111
+ uri (1.1.1)
95
112
 
96
113
  PLATFORMS
97
- aarch64-linux
98
- arm-linux
114
+ aarch64-linux-gnu
115
+ aarch64-linux-musl
116
+ arm-linux-gnu
117
+ arm-linux-musl
99
118
  arm64-darwin
100
- x86-linux
119
+ x86-linux-gnu
120
+ x86-linux-musl
101
121
  x86_64-darwin
102
- x86_64-linux
122
+ x86_64-linux-gnu
123
+ x86_64-linux-musl
103
124
 
104
125
  DEPENDENCIES
105
- bundler (~> 2.3)
126
+ bundler (~> 2.6)
106
127
  bundler-audit
107
128
  hierarchable!
108
129
  minitest (~> 5.0)
@@ -113,8 +134,8 @@ DEPENDENCIES
113
134
  rubocop-rails
114
135
  rubocop-rake
115
136
  ruby_audit
116
- sqlite3
137
+ sqlite3 (~> 2.0, >= 2.0.2)
117
138
  temping (~> 4.0)
118
139
 
119
140
  BUNDLED WITH
120
- 2.5.6
141
+ 2.6.9
data/hierarchable.gemspec CHANGED
@@ -41,9 +41,9 @@ Gem::Specification.new do |spec|
41
41
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
42
42
  spec.require_paths = ['lib']
43
43
 
44
- spec.required_ruby_version = '>= 3.2'
44
+ spec.required_ruby_version = '>= 3.4'
45
45
 
46
- spec.add_runtime_dependency('activerecord', '> 4.2.0')
47
- spec.add_runtime_dependency('activesupport', '> 4.2.0')
46
+ spec.add_dependency('activerecord', '> 4.2.0')
47
+ spec.add_dependency('activesupport', '> 4.2.0')
48
48
  spec.metadata['rubygems_mfa_required'] = 'true'
49
49
  end
@@ -351,8 +351,8 @@ module Hierarchable
351
351
  models.each do |model|
352
352
  model = model.safe_constantize if model.is_a?(String)
353
353
  query = model.where(
354
- hierarchy_parent_type: public_send(:hierarchy_parent_type),
355
- hierarchy_parent_id: public_send(:hierarchy_parent_id)
354
+ hierarchy_parent_type:,
355
+ hierarchy_parent_id:
356
356
  )
357
357
  query = query.where.not(id:) if model == self.class && !include_self
358
358
  result[model.to_s] = query
@@ -455,7 +455,7 @@ module Hierarchable
455
455
  hierarchy_root_id: id
456
456
  )
457
457
  else
458
- path = public_send(:hierarchy_full_path)
458
+ path = hierarchy_full_path
459
459
  model.where(
460
460
  'hierarchy_ancestors_path LIKE ?',
461
461
  "#{model.sanitize_sql_like(path)}%"
@@ -607,12 +607,12 @@ module Hierarchable
607
607
  path = []
608
608
  hierarchy_full_path.split(hierarchable_config[:path_separator])
609
609
  .each do |record|
610
- ancestor_class_name, ancestor_id = record.split(
611
- hierarchable_config[:record_separator]
612
- )
613
- ancestor_class = ancestor_class_name.safe_constantize
614
- path << ancestor_class
615
- path << ancestor_class.find(ancestor_id)
610
+ ancestor_class_name, ancestor_id = record.split(
611
+ hierarchable_config[:record_separator]
612
+ )
613
+ ancestor_class = ancestor_class_name.safe_constantize
614
+ path << ancestor_class
615
+ path << ancestor_class.find(ancestor_id)
616
616
  end
617
617
  path
618
618
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hierarchable
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hierarchable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick R. Schmid
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -47,6 +46,7 @@ extensions: []
47
46
  extra_rdoc_files: []
48
47
  files:
49
48
  - ".circleci/config.yml"
49
+ - ".github/dependabot.yml"
50
50
  - ".gitignore"
51
51
  - ".rubocop.yml"
52
52
  - ".ruby-gemset"
@@ -70,7 +70,6 @@ metadata:
70
70
  source_code_uri: https://github.com/prschmid/hierarchable
71
71
  changelog_uri: https://github.com/prschmid/hierarchable
72
72
  rubygems_mfa_required: 'true'
73
- post_install_message:
74
73
  rdoc_options: []
75
74
  require_paths:
76
75
  - lib
@@ -78,15 +77,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
77
  requirements:
79
78
  - - ">="
80
79
  - !ruby/object:Gem::Version
81
- version: '3.2'
80
+ version: '3.4'
82
81
  required_rubygems_version: !ruby/object:Gem::Requirement
83
82
  requirements:
84
83
  - - ">="
85
84
  - !ruby/object:Gem::Version
86
85
  version: '0'
87
86
  requirements: []
88
- rubygems_version: 3.5.6
89
- signing_key:
87
+ rubygems_version: 3.6.9
90
88
  specification_version: 4
91
89
  summary: Cross model hierarchical (parent, child, sibling) relationship between ActiveRecord
92
90
  models.