Skip to content

Commit 97ae692

Browse files
committed
Fix active_record_doctor references warning
1 parent 9bd6507 commit 97ae692

File tree

3 files changed

+29
-34
lines changed

3 files changed

+29
-34
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gem 'sass-rails', '~> 5.0'
2525
gem 'uglifier', '>= 1.3.0'
2626
# See https://github.com/rails/execjs#readme for more supported runtimes
2727
# gem 'mini_racer', platforms: :ruby
28-
gem 'active_record_doctor', '1.7.0'
28+
2929
# Use CoffeeScript for .coffee assets and views
3030
gem 'coffee-rails', '~> 4.2'
3131
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks

lib/inquisition/active_record_doctor/runner.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ module Inquisition
1111
module ActiveRecordDoctor
1212
class Runner < ::Inquisition::Runner
1313
TASKS = {
14-
# ::ActiveRecordDoctor::Tasks::ExtraneousIndexes => Category::PERFORMANCE,
15-
# ::ActiveRecordDoctor::Tasks::MissingForeignKeys => Category::BUG_RISK,
16-
# ::ActiveRecordDoctor::Tasks::MissingNonNullConstraint => Category::BUG_RISK,
17-
# ::ActiveRecordDoctor::Tasks::MissingPresenceValidation => Category::BUG_RISK,
18-
# ::ActiveRecordDoctor::Tasks::MissingUniqueIndexes => Category::BUG_RISK,
14+
::ActiveRecordDoctor::Tasks::ExtraneousIndexes => Category::PERFORMANCE,
15+
::ActiveRecordDoctor::Tasks::MissingForeignKeys => Category::BUG_RISK,
16+
::ActiveRecordDoctor::Tasks::MissingNonNullConstraint => Category::BUG_RISK,
17+
::ActiveRecordDoctor::Tasks::MissingPresenceValidation => Category::BUG_RISK,
18+
::ActiveRecordDoctor::Tasks::MissingUniqueIndexes => Category::BUG_RISK,
1919
::ActiveRecordDoctor::Tasks::UndefinedTableReferences => Category::UNUSED_CODE,
20-
# ::ActiveRecordDoctor::Tasks::UnindexedDeletedAt => Category::PERFORMANCE,
21-
# ::ActiveRecordDoctor::Tasks::UnindexedForeignKeys => Category::PERFORMANCE
20+
::ActiveRecordDoctor::Tasks::UnindexedDeletedAt => Category::PERFORMANCE,
21+
::ActiveRecordDoctor::Tasks::UnindexedForeignKeys => Category::PERFORMANCE
2222
}.freeze
2323

2424
def call
2525
TASKS.keys.each do |ard_task|
2626
ard_task.run.first.each do |table, column|
27-
binding.pry
27+
next unless table && column
28+
2829
@issues << Inquisition::Issue.new(Issue.new(ard_task, table, column).to_h.merge(runner: self))
2930
end
3031
end
Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
# - severity: :low
2-
# category: :bug_risk
3-
# message: 'active_storage_attachments has missing foreign keys, details: blob_id'
4-
# - severity: :low
5-
# category: :bug_risk
6-
# message: 'projects has missing foreign keys, details: user_id'
7-
# - severity: :low
8-
# category: :bug_risk
9-
# message: 'projects has missing non null constraint, details: name, user_id'
10-
# - severity: :low
11-
# category: :bug_risk
12-
# message: 'ActiveStorage::Attachment has missing presence validation, details: name, record_type'
13-
# - severity: :low
14-
# category: :bug_risk
15-
# message: 'ActiveStorage::Blob has missing presence validation, details: key, filename, byte_size, checksum'
161
- severity: :low
17-
category: :unused_code
18-
message: ' has undefined table references, details: n/a'
2+
category: :bug_risk
3+
message: 'active_storage_attachments has missing foreign keys, details: blob_id'
194
- severity: :low
20-
category: :unused_code
21-
message: 'true has undefined table references, details: n/a'
22-
# - severity: :low
23-
# category: :performance
24-
# message: 'active_storage_attachments has unindexed foreign keys, details: record_id'
25-
# - severity: :low
26-
# category: :performance
27-
# message: 'projects has unindexed foreign keys, details: user_id'
5+
category: :bug_risk
6+
message: 'projects has missing foreign keys, details: user_id'
7+
- severity: :low
8+
category: :bug_risk
9+
message: 'projects has missing non null constraint, details: name, user_id'
10+
- severity: :low
11+
category: :bug_risk
12+
message: 'ActiveStorage::Attachment has missing presence validation, details: name, record_type'
13+
- severity: :low
14+
category: :bug_risk
15+
message: 'ActiveStorage::Blob has missing presence validation, details: key, filename, byte_size, checksum'
16+
- severity: :low
17+
category: :performance
18+
message: 'active_storage_attachments has unindexed foreign keys, details: record_id'
19+
- severity: :low
20+
category: :performance
21+
message: 'projects has unindexed foreign keys, details: user_id'

0 commit comments

Comments
 (0)