lol_dba 2.4.0 → 3.0.0

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- lol_dba (2.4.0)
4
+ lol_dba (3.0.0)
5
5
  actionpack
6
6
  activerecord
7
7
  railties
@@ -9,97 +9,162 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (7.0.3.1)
13
- actionview (= 7.0.3.1)
14
- activesupport (= 7.0.3.1)
15
- rack (~> 2.0, >= 2.2.0)
12
+ actionpack (7.2.3)
13
+ actionview (= 7.2.3)
14
+ activesupport (= 7.2.3)
15
+ cgi
16
+ nokogiri (>= 1.8.5)
17
+ racc
18
+ rack (>= 2.2.4, < 3.3)
19
+ rack-session (>= 1.0.1)
16
20
  rack-test (>= 0.6.3)
17
- rails-dom-testing (~> 2.0)
18
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (7.0.3.1)
20
- activesupport (= 7.0.3.1)
21
+ rails-dom-testing (~> 2.2)
22
+ rails-html-sanitizer (~> 1.6)
23
+ useragent (~> 0.16)
24
+ actionview (7.2.3)
25
+ activesupport (= 7.2.3)
21
26
  builder (~> 3.1)
22
- erubi (~> 1.4)
23
- rails-dom-testing (~> 2.0)
24
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activemodel (7.0.3.1)
26
- activesupport (= 7.0.3.1)
27
- activerecord (7.0.3.1)
28
- activemodel (= 7.0.3.1)
29
- activesupport (= 7.0.3.1)
30
- activesupport (7.0.3.1)
31
- concurrent-ruby (~> 1.0, >= 1.0.2)
27
+ cgi
28
+ erubi (~> 1.11)
29
+ rails-dom-testing (~> 2.2)
30
+ rails-html-sanitizer (~> 1.6)
31
+ activemodel (7.2.3)
32
+ activesupport (= 7.2.3)
33
+ activerecord (7.2.3)
34
+ activemodel (= 7.2.3)
35
+ activesupport (= 7.2.3)
36
+ timeout (>= 0.4.0)
37
+ activesupport (7.2.3)
38
+ base64
39
+ benchmark (>= 0.3)
40
+ bigdecimal
41
+ concurrent-ruby (~> 1.0, >= 1.3.1)
42
+ connection_pool (>= 2.2.5)
43
+ drb
32
44
  i18n (>= 1.6, < 2)
45
+ logger (>= 1.4.2)
33
46
  minitest (>= 5.1)
34
- tzinfo (~> 2.0)
35
- appraisal (2.4.1)
47
+ securerandom (>= 0.3)
48
+ tzinfo (~> 2.0, >= 2.0.5)
49
+ appraisal (2.5.0)
36
50
  bundler
37
51
  rake
38
52
  thor (>= 0.14.0)
39
- bigdecimal (3.1.2)
40
- builder (3.2.4)
41
- concurrent-ruby (1.1.10)
53
+ base64 (0.3.0)
54
+ benchmark (0.5.0)
55
+ bigdecimal (4.0.1)
56
+ builder (3.3.0)
57
+ cgi (0.5.1)
58
+ concurrent-ruby (1.3.6)
59
+ connection_pool (3.0.2)
42
60
  crass (1.0.6)
43
- diff-lcs (1.5.0)
44
- docile (1.4.0)
45
- erubi (1.11.0)
46
- i18n (1.12.0)
61
+ date (3.5.1)
62
+ diff-lcs (1.6.2)
63
+ docile (1.4.1)
64
+ drb (2.2.3)
65
+ erb (6.0.2)
66
+ erubi (1.13.1)
67
+ i18n (1.14.8)
47
68
  concurrent-ruby (~> 1.0)
48
- loofah (2.18.0)
69
+ io-console (0.8.2)
70
+ irb (1.17.0)
71
+ pp (>= 0.6.0)
72
+ prism (>= 1.3.0)
73
+ rdoc (>= 4.0.0)
74
+ reline (>= 0.4.2)
75
+ logger (1.7.0)
76
+ loofah (2.25.1)
49
77
  crass (~> 1.0.2)
50
- nokogiri (>= 1.5.9)
51
- method_source (1.0.0)
52
- minitest (5.16.2)
53
- nokogiri (1.13.8-arm64-darwin)
78
+ nokogiri (>= 1.12.0)
79
+ mini_portile2 (2.8.9)
80
+ minitest (6.0.2)
81
+ drb (~> 2.0)
82
+ prism (~> 1.5)
83
+ nokogiri (1.19.2)
84
+ mini_portile2 (~> 2.8.2)
54
85
  racc (~> 1.4)
55
- racc (1.6.0)
56
- rack (2.2.4)
57
- rack-test (2.0.2)
86
+ nokogiri (1.19.2-arm64-darwin)
87
+ racc (~> 1.4)
88
+ pp (0.6.3)
89
+ prettyprint
90
+ prettyprint (0.2.0)
91
+ prism (1.9.0)
92
+ psych (5.3.1)
93
+ date
94
+ stringio
95
+ racc (1.8.1)
96
+ rack (3.2.5)
97
+ rack-session (2.1.1)
98
+ base64 (>= 0.1.0)
99
+ rack (>= 3.0.0)
100
+ rack-test (2.2.0)
58
101
  rack (>= 1.3)
59
- rails-dom-testing (2.0.3)
60
- activesupport (>= 4.2.0)
102
+ rackup (2.3.1)
103
+ rack (>= 3)
104
+ rails-dom-testing (2.3.0)
105
+ activesupport (>= 5.0.0)
106
+ minitest
61
107
  nokogiri (>= 1.6)
62
- rails-html-sanitizer (1.4.3)
63
- loofah (~> 2.3)
64
- railties (7.0.3.1)
65
- actionpack (= 7.0.3.1)
66
- activesupport (= 7.0.3.1)
67
- method_source
108
+ rails-html-sanitizer (1.7.0)
109
+ loofah (~> 2.25)
110
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
111
+ railties (7.2.3)
112
+ actionpack (= 7.2.3)
113
+ activesupport (= 7.2.3)
114
+ cgi
115
+ irb (~> 1.13)
116
+ rackup (>= 1.0.0)
68
117
  rake (>= 12.2)
69
- thor (~> 1.0)
70
- zeitwerk (~> 2.5)
71
- rake (13.0.6)
72
- rspec-core (3.11.0)
73
- rspec-support (~> 3.11.0)
74
- rspec-expectations (3.11.0)
118
+ thor (~> 1.0, >= 1.2.2)
119
+ tsort (>= 0.2)
120
+ zeitwerk (~> 2.6)
121
+ rake (13.3.1)
122
+ rdoc (7.2.0)
123
+ erb
124
+ psych (>= 4.0.0)
125
+ tsort
126
+ reline (0.6.3)
127
+ io-console (~> 0.5)
128
+ rspec-core (3.13.6)
129
+ rspec-support (~> 3.13.0)
130
+ rspec-expectations (3.13.5)
75
131
  diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.11.0)
77
- rspec-mocks (3.11.1)
132
+ rspec-support (~> 3.13.0)
133
+ rspec-mocks (3.13.8)
78
134
  diff-lcs (>= 1.2.0, < 2.0)
79
- rspec-support (~> 3.11.0)
80
- rspec-rails (5.1.2)
81
- actionpack (>= 5.2)
82
- activesupport (>= 5.2)
83
- railties (>= 5.2)
84
- rspec-core (~> 3.10)
85
- rspec-expectations (~> 3.10)
86
- rspec-mocks (~> 3.10)
87
- rspec-support (~> 3.10)
88
- rspec-support (3.11.0)
89
- simplecov (0.21.2)
135
+ rspec-support (~> 3.13.0)
136
+ rspec-rails (8.0.4)
137
+ actionpack (>= 7.2)
138
+ activesupport (>= 7.2)
139
+ railties (>= 7.2)
140
+ rspec-core (>= 3.13.0, < 5.0.0)
141
+ rspec-expectations (>= 3.13.0, < 5.0.0)
142
+ rspec-mocks (>= 3.13.0, < 5.0.0)
143
+ rspec-support (>= 3.13.0, < 5.0.0)
144
+ rspec-support (3.13.7)
145
+ securerandom (0.4.1)
146
+ simplecov (0.22.0)
90
147
  docile (~> 1.1)
91
148
  simplecov-html (~> 0.11)
92
149
  simplecov_json_formatter (~> 0.1)
93
- simplecov-html (0.12.3)
150
+ simplecov-html (0.13.2)
94
151
  simplecov_json_formatter (0.1.4)
95
- sqlite3 (1.4.4)
96
- thor (1.2.1)
97
- tzinfo (2.0.5)
152
+ sqlite3 (2.9.2)
153
+ mini_portile2 (~> 2.8.0)
154
+ sqlite3 (2.9.2-arm64-darwin)
155
+ stringio (3.2.0)
156
+ thor (1.5.0)
157
+ timeout (0.6.1)
158
+ tsort (0.2.0)
159
+ tzinfo (2.0.6)
98
160
  concurrent-ruby (~> 1.0)
99
- zeitwerk (2.6.0)
161
+ useragent (0.16.11)
162
+ zeitwerk (2.7.5)
100
163
 
101
164
  PLATFORMS
102
165
  arm64-darwin-21
166
+ arm64-darwin-22
167
+ ruby
103
168
 
104
169
  DEPENDENCIES
105
170
  actionpack (~> 7.0)
@@ -113,4 +178,4 @@ DEPENDENCIES
113
178
  sqlite3
114
179
 
115
180
  BUNDLED WITH
116
- 2.3.19
181
+ 2.4.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 8.0"
6
+ gem "actionpack", "~> 8.0"
7
+ gem "railties", "~> 8.0"
8
+ gem "sqlite3"
9
+ gem "bigdecimal"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,170 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ lol_dba (3.0.0)
5
+ actionpack
6
+ activerecord
7
+ railties
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionpack (8.1.2)
13
+ actionview (= 8.1.2)
14
+ activesupport (= 8.1.2)
15
+ nokogiri (>= 1.8.5)
16
+ rack (>= 2.2.4)
17
+ rack-session (>= 1.0.1)
18
+ rack-test (>= 0.6.3)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ useragent (~> 0.16)
22
+ actionview (8.1.2)
23
+ activesupport (= 8.1.2)
24
+ builder (~> 3.1)
25
+ erubi (~> 1.11)
26
+ rails-dom-testing (~> 2.2)
27
+ rails-html-sanitizer (~> 1.6)
28
+ activemodel (8.1.2)
29
+ activesupport (= 8.1.2)
30
+ activerecord (8.1.2)
31
+ activemodel (= 8.1.2)
32
+ activesupport (= 8.1.2)
33
+ timeout (>= 0.4.0)
34
+ activesupport (8.1.2)
35
+ base64
36
+ bigdecimal
37
+ concurrent-ruby (~> 1.0, >= 1.3.1)
38
+ connection_pool (>= 2.2.5)
39
+ drb
40
+ i18n (>= 1.6, < 2)
41
+ json
42
+ logger (>= 1.4.2)
43
+ minitest (>= 5.1)
44
+ securerandom (>= 0.3)
45
+ tzinfo (~> 2.0, >= 2.0.5)
46
+ uri (>= 0.13.1)
47
+ appraisal (2.5.0)
48
+ bundler
49
+ rake
50
+ thor (>= 0.14.0)
51
+ base64 (0.3.0)
52
+ bigdecimal (4.0.1)
53
+ builder (3.3.0)
54
+ concurrent-ruby (1.3.6)
55
+ connection_pool (3.0.2)
56
+ crass (1.0.6)
57
+ date (3.5.1)
58
+ diff-lcs (1.6.2)
59
+ docile (1.4.1)
60
+ drb (2.2.3)
61
+ erb (6.0.2)
62
+ erubi (1.13.1)
63
+ i18n (1.14.8)
64
+ concurrent-ruby (~> 1.0)
65
+ io-console (0.8.2)
66
+ irb (1.17.0)
67
+ pp (>= 0.6.0)
68
+ prism (>= 1.3.0)
69
+ rdoc (>= 4.0.0)
70
+ reline (>= 0.4.2)
71
+ json (2.19.2)
72
+ logger (1.7.0)
73
+ loofah (2.25.1)
74
+ crass (~> 1.0.2)
75
+ nokogiri (>= 1.12.0)
76
+ minitest (6.0.2)
77
+ drb (~> 2.0)
78
+ prism (~> 1.5)
79
+ nokogiri (1.19.2-arm64-darwin)
80
+ racc (~> 1.4)
81
+ pp (0.6.3)
82
+ prettyprint
83
+ prettyprint (0.2.0)
84
+ prism (1.9.0)
85
+ psych (5.3.1)
86
+ date
87
+ stringio
88
+ racc (1.8.1)
89
+ rack (3.2.5)
90
+ rack-session (2.1.1)
91
+ base64 (>= 0.1.0)
92
+ rack (>= 3.0.0)
93
+ rack-test (2.2.0)
94
+ rack (>= 1.3)
95
+ rackup (2.3.1)
96
+ rack (>= 3)
97
+ rails-dom-testing (2.3.0)
98
+ activesupport (>= 5.0.0)
99
+ minitest
100
+ nokogiri (>= 1.6)
101
+ rails-html-sanitizer (1.7.0)
102
+ loofah (~> 2.25)
103
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
104
+ railties (8.1.2)
105
+ actionpack (= 8.1.2)
106
+ activesupport (= 8.1.2)
107
+ irb (~> 1.13)
108
+ rackup (>= 1.0.0)
109
+ rake (>= 12.2)
110
+ thor (~> 1.0, >= 1.2.2)
111
+ tsort (>= 0.2)
112
+ zeitwerk (~> 2.6)
113
+ rake (13.3.1)
114
+ rdoc (7.2.0)
115
+ erb
116
+ psych (>= 4.0.0)
117
+ tsort
118
+ reline (0.6.3)
119
+ io-console (~> 0.5)
120
+ rspec-core (3.13.6)
121
+ rspec-support (~> 3.13.0)
122
+ rspec-expectations (3.13.5)
123
+ diff-lcs (>= 1.2.0, < 2.0)
124
+ rspec-support (~> 3.13.0)
125
+ rspec-mocks (3.13.8)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.13.0)
128
+ rspec-rails (8.0.4)
129
+ actionpack (>= 7.2)
130
+ activesupport (>= 7.2)
131
+ railties (>= 7.2)
132
+ rspec-core (>= 3.13.0, < 5.0.0)
133
+ rspec-expectations (>= 3.13.0, < 5.0.0)
134
+ rspec-mocks (>= 3.13.0, < 5.0.0)
135
+ rspec-support (>= 3.13.0, < 5.0.0)
136
+ rspec-support (3.13.7)
137
+ securerandom (0.4.1)
138
+ simplecov (0.22.0)
139
+ docile (~> 1.1)
140
+ simplecov-html (~> 0.11)
141
+ simplecov_json_formatter (~> 0.1)
142
+ simplecov-html (0.13.2)
143
+ simplecov_json_formatter (0.1.4)
144
+ sqlite3 (2.9.2-arm64-darwin)
145
+ stringio (3.2.0)
146
+ thor (1.5.0)
147
+ timeout (0.6.1)
148
+ tsort (0.2.0)
149
+ tzinfo (2.0.6)
150
+ concurrent-ruby (~> 1.0)
151
+ uri (1.1.1)
152
+ useragent (0.16.11)
153
+ zeitwerk (2.7.5)
154
+
155
+ PLATFORMS
156
+ arm64-darwin-22
157
+
158
+ DEPENDENCIES
159
+ actionpack (~> 8.0)
160
+ activerecord (~> 8.0)
161
+ appraisal
162
+ bigdecimal
163
+ lol_dba!
164
+ railties (~> 8.0)
165
+ rspec-rails
166
+ simplecov
167
+ sqlite3
168
+
169
+ BUNDLED WITH
170
+ 2.3.19
@@ -68,7 +68,7 @@ module LolDba
68
68
 
69
69
  def self.model_classes
70
70
  ActiveRecord::Base.descendants.select do |obj|
71
- Class == obj.class && session_store?(obj)
71
+ Class == obj.class && session_store?(obj) && obj.table_exists?
72
72
  end
73
73
  end
74
74
 
@@ -3,7 +3,13 @@ module LolDba
3
3
  class << self
4
4
  def migrator
5
5
  if ::ActiveRecord::VERSION::MAJOR >= 6
6
- ActiveRecord::Migrator.new(:up, migrations_path, ActiveRecord::SchemaMigration)
6
+ ar_version = Gem::Version.new(ActiveRecord::VERSION::STRING)
7
+ if ar_version >= Gem::Version.new('7.2')
8
+ pool = ActiveRecord::Base.connection_pool
9
+ ActiveRecord::Migrator.new(:up, migrations_path, ActiveRecord::SchemaMigration.new(pool), ActiveRecord::InternalMetadata.new(pool))
10
+ else
11
+ ActiveRecord::Migrator.new(:up, migrations_path, ActiveRecord::SchemaMigration)
12
+ end
7
13
  else
8
14
  ActiveRecord::Migrator.new(:up, migrations_path)
9
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LolDba
4
- VERSION = '2.4.0' unless defined? LolDba::VERSION
4
+ VERSION = '3.0.0' unless defined? LolDba::VERSION
5
5
  end
@@ -1,4 +1,16 @@
1
1
  RSpec.describe LolDba::IndexFinder do
2
+ describe '.model_classes' do
3
+ it 'excludes models without database tables' do
4
+ model_classes = described_class.model_classes
5
+ expect(model_classes).not_to include(Wrong)
6
+ end
7
+
8
+ it 'includes models with database tables' do
9
+ model_classes = described_class.model_classes
10
+ expect(model_classes).to include(User)
11
+ end
12
+ end
13
+
2
14
  describe '.run' do
3
15
  before do
4
16
  allow(described_class).to receive(:check_for_indexes).and_return(missing_indexes)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lol_dba
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Plentz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-14 00:00:00.000000000 Z
11
+ date: 2026-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -106,11 +106,10 @@ extra_rdoc_files: []
106
106
  files:
107
107
  - ".codeclimate.yml"
108
108
  - ".github/dependabot.yml"
109
- - ".github/workflows/rubyonrails.yml"
109
+ - ".github/workflows/build.yml"
110
110
  - ".gitignore"
111
111
  - ".rspec"
112
112
  - ".rubocop.yml"
113
- - ".travis.yml"
114
113
  - Appraisals
115
114
  - Gemfile
116
115
  - Gemfile.lock
@@ -135,6 +134,8 @@ files:
135
134
  - gemfiles/rails_6.gemfile.lock
136
135
  - gemfiles/rails_7.gemfile
137
136
  - gemfiles/rails_7.gemfile.lock
137
+ - gemfiles/rails_8.gemfile
138
+ - gemfiles/rails_8.gemfile.lock
138
139
  - lib/lol_dba.rb
139
140
  - lib/lol_dba/cli.rb
140
141
  - lib/lol_dba/index_finding/belongs_to.rb
@@ -202,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
203
  - !ruby/object:Gem::Version
203
204
  version: '0'
204
205
  requirements: []
205
- rubygems_version: 3.3.7
206
+ rubygems_version: 3.4.6
206
207
  signing_key:
207
208
  specification_version: 4
208
209
  summary: A small package of rake tasks to track down missing database indexes and
data/.travis.yml DELETED
@@ -1,35 +0,0 @@
1
- env:
2
- global:
3
- - CC_TEST_REPORTER_ID=46e5fb2273e7c6fb1beaad7c0f14ad898f0eed65d98a20c80fe8eb4e216a7ff0
4
- language: ruby
5
- cache: bundler
6
- before_install:
7
- - gem update --system
8
- - gem install bundler
9
- rvm:
10
- - 2.6.5
11
- - ruby-head
12
- gemfile:
13
- - gemfiles/rails_3_2.gemfile
14
- - gemfiles/rails_4_0.gemfile
15
- - gemfiles/rails_4_1.gemfile
16
- - gemfiles/rails_4_2.gemfile
17
- - gemfiles/rails_5_0.gemfile
18
- - gemfiles/rails_5_1.gemfile
19
- - gemfiles/rails_5_2.gemfile
20
- - gemfiles/rails_6.gemfile
21
- before_script:
22
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
23
- - chmod +x ./cc-test-reporter
24
- - ./cc-test-reporter before-build
25
- script: "bundle exec rake"
26
- after_script:
27
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
28
- notifications:
29
- email:
30
- recipients:
31
- - diego@plentz.io
32
- matrix:
33
- fast_finish: true
34
- allow_failures:
35
- - rvm: ruby-head