active_record_doctor 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +28 -1
- data/lib/active_record_doctor/printers/io_printer.rb +21 -3
- data/lib/active_record_doctor/tasks/base.rb +14 -0
- data/lib/active_record_doctor/tasks/incorrect_boolean_presence_validation.rb +33 -0
- data/lib/active_record_doctor/tasks/missing_non_null_constraint.rb +8 -1
- data/lib/active_record_doctor/tasks/missing_presence_validation.rb +37 -5
- data/lib/active_record_doctor/tasks/missing_unique_indexes.rb +6 -1
- data/lib/active_record_doctor/tasks/undefined_table_references.rb +17 -2
- data/lib/active_record_doctor/version.rb +1 -1
- data/lib/tasks/active_record_doctor.rake +1 -0
- data/test/active_record_doctor/tasks/incorrect_boolean_presence_validation_test.rb +33 -0
- data/test/active_record_doctor/tasks/missing_non_null_constraint_test.rb +13 -0
- data/test/active_record_doctor/tasks/missing_presence_validation_test.rb +61 -0
- data/test/active_record_doctor/tasks/undefined_table_references_test.rb +51 -0
- data/test/dummy/app/assets/config/manifest.js +1 -0
- data/test/dummy/log/development.log +39 -0
- data/test/dummy/log/test.log +12272 -0
- data/test/test_helper.rb +4 -0
- metadata +29 -10
- data/test/support/forking_test.rb +0 -28
data/test/test_helper.rb
CHANGED
@@ -9,5 +9,9 @@ require "rails/test_help"
|
|
9
9
|
# to be shown.
|
10
10
|
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
11
11
|
|
12
|
+
# Run each test method in a separate process.
|
13
|
+
require 'minitest/fork_executor'
|
14
|
+
Minitest.parallel_executor = Minitest::ForkExecutor.new
|
15
|
+
|
12
16
|
# Load support files
|
13
17
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_doctor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Navis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -70,16 +70,30 @@ dependencies:
|
|
70
70
|
name: temping
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.10'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest-fork_executor
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
96
|
+
version: '1.0'
|
83
97
|
description:
|
84
98
|
email:
|
85
99
|
- contact@gregnavis.com
|
@@ -97,6 +111,7 @@ files:
|
|
97
111
|
- lib/active_record_doctor/tasks.rb
|
98
112
|
- lib/active_record_doctor/tasks/base.rb
|
99
113
|
- lib/active_record_doctor/tasks/extraneous_indexes.rb
|
114
|
+
- lib/active_record_doctor/tasks/incorrect_boolean_presence_validation.rb
|
100
115
|
- lib/active_record_doctor/tasks/missing_foreign_keys.rb
|
101
116
|
- lib/active_record_doctor/tasks/missing_non_null_constraint.rb
|
102
117
|
- lib/active_record_doctor/tasks/missing_presence_validation.rb
|
@@ -110,14 +125,17 @@ files:
|
|
110
125
|
- lib/tasks/active_record_doctor.rake
|
111
126
|
- test/active_record_doctor/printers/io_printer_test.rb
|
112
127
|
- test/active_record_doctor/tasks/extraneous_indexes_test.rb
|
128
|
+
- test/active_record_doctor/tasks/incorrect_boolean_presence_validation_test.rb
|
113
129
|
- test/active_record_doctor/tasks/missing_foreign_keys_test.rb
|
114
130
|
- test/active_record_doctor/tasks/missing_non_null_constraint_test.rb
|
115
131
|
- test/active_record_doctor/tasks/missing_presence_validation_test.rb
|
116
132
|
- test/active_record_doctor/tasks/missing_unique_indexes_test.rb
|
133
|
+
- test/active_record_doctor/tasks/undefined_table_references_test.rb
|
117
134
|
- test/active_record_doctor/tasks/unindexed_deleted_at_test.rb
|
118
135
|
- test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb
|
119
136
|
- test/dummy/README.rdoc
|
120
137
|
- test/dummy/Rakefile
|
138
|
+
- test/dummy/app/assets/config/manifest.js
|
121
139
|
- test/dummy/app/assets/javascripts/application.js
|
122
140
|
- test/dummy/app/assets/stylesheets/application.css
|
123
141
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -157,7 +175,6 @@ files:
|
|
157
175
|
- test/dummy/public/500.html
|
158
176
|
- test/dummy/public/favicon.ico
|
159
177
|
- test/support/assertions.rb
|
160
|
-
- test/support/forking_test.rb
|
161
178
|
- test/support/temping.rb
|
162
179
|
- test/test_helper.rb
|
163
180
|
homepage: https://github.com/gregnavis/active_record_doctor
|
@@ -180,18 +197,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
197
|
version: '0'
|
181
198
|
requirements: []
|
182
199
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.
|
200
|
+
rubygems_version: 2.7.6
|
184
201
|
signing_key:
|
185
202
|
specification_version: 4
|
186
|
-
summary:
|
203
|
+
summary: Identify database issues before they hit production.
|
187
204
|
test_files:
|
188
205
|
- test/test_helper.rb
|
189
206
|
- test/active_record_doctor/printers/io_printer_test.rb
|
190
207
|
- test/active_record_doctor/tasks/unindexed_deleted_at_test.rb
|
191
208
|
- test/active_record_doctor/tasks/missing_foreign_keys_test.rb
|
192
209
|
- test/active_record_doctor/tasks/extraneous_indexes_test.rb
|
210
|
+
- test/active_record_doctor/tasks/incorrect_boolean_presence_validation_test.rb
|
193
211
|
- test/active_record_doctor/tasks/missing_non_null_constraint_test.rb
|
194
212
|
- test/active_record_doctor/tasks/missing_presence_validation_test.rb
|
213
|
+
- test/active_record_doctor/tasks/undefined_table_references_test.rb
|
195
214
|
- test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb
|
196
215
|
- test/active_record_doctor/tasks/missing_unique_indexes_test.rb
|
197
216
|
- test/dummy/README.rdoc
|
@@ -204,6 +223,7 @@ test_files:
|
|
204
223
|
- test/dummy/app/helpers/application_helper.rb
|
205
224
|
- test/dummy/app/controllers/application_controller.rb
|
206
225
|
- test/dummy/app/assets/stylesheets/application.css
|
226
|
+
- test/dummy/app/assets/config/manifest.js
|
207
227
|
- test/dummy/app/assets/javascripts/application.js
|
208
228
|
- test/dummy/app/views/layouts/application.html.erb
|
209
229
|
- test/dummy/app/models/application_record.rb
|
@@ -235,5 +255,4 @@ test_files:
|
|
235
255
|
- test/dummy/Rakefile
|
236
256
|
- test/dummy/config.ru
|
237
257
|
- test/support/temping.rb
|
238
|
-
- test/support/forking_test.rb
|
239
258
|
- test/support/assertions.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
class ActiveSupport::TestCase
|
2
|
-
def run
|
3
|
-
read_io, write_io = IO.pipe
|
4
|
-
read_io.binmode
|
5
|
-
write_io.binmode
|
6
|
-
|
7
|
-
if fork
|
8
|
-
# Parent: load the result sent from the child
|
9
|
-
|
10
|
-
write_io.close
|
11
|
-
result = Marshal.load(read_io)
|
12
|
-
read_io.close
|
13
|
-
|
14
|
-
Process.wait
|
15
|
-
else
|
16
|
-
# Child: just run normally, dump the result, and exit the process to
|
17
|
-
# avoid double-reporting.
|
18
|
-
result = super
|
19
|
-
|
20
|
-
read_io.close
|
21
|
-
Marshal.dump(result, write_io)
|
22
|
-
write_io.close
|
23
|
-
exit
|
24
|
-
end
|
25
|
-
|
26
|
-
result
|
27
|
-
end
|
28
|
-
end
|