Class: DatabaseConsistency::Writers::AutofixWriter

Inherits:
BaseWriter
  • Object
show all
Defined in:
lib/database_consistency/writers/autofix_writer.rb

Overview

The simplest formatter

Constant Summary collapse

SLUG_TO_GENERATOR =
{
  missing_foreign_key: Autofix::MissingForeignKey,
  null_constraint_missing: Autofix::NullConstraintMissing,
  association_missing_null_constraint: Autofix::NullConstraintMissing
}.freeze

Instance Attribute Summary

Attributes inherited from BaseWriter

#config, #results

Instance Method Summary collapse

Methods inherited from BaseWriter

#initialize, write

Constructor Details

This class inherits a constructor from DatabaseConsistency::Writers::BaseWriter

Instance Method Details

#writeObject



14
15
16
17
18
19
20
# File 'lib/database_consistency/writers/autofix_writer.rb', line 14

def write
  reports.each do |report|
    next unless fix?(report)

    fix(report)
  end
end