Class: ActiveRecord::DataIntegrity::Accordance::TablePresence

Inherits:
Cop
  • Object
show all
Defined in:
lib/active_record/data_integrity/cop/accordance/table_presence.rb

Overview

Check the presence of the underlying table for the model

Instance Attribute Summary

Attributes inherited from Cop

#model

Instance Method Summary collapse

Methods inherited from Cop

cop_name, #initialize, #log, #progress

Constructor Details

This class inherits a constructor from ActiveRecord::DataIntegrity::Cop

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'lib/active_record/data_integrity/cop/accordance/table_presence.rb', line 10

def call
  connection.table_exists?(model.table_name).tap do |result|
    log("has no underlying table #{model.table_name}") unless result
    progress(result, 'T')
  end
end