Sha256: 477faebf1c867a647fe171e79cd999df2352a8905ee67626f8dc481b00bd0a40

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

# frozen_string_literal: true

require_relative '../cop'

module ActiveRecord
  module DataIntegrity
    module Accordance
      # Check the presence of the underlying table for the model
      class TablePresence < ActiveRecord::DataIntegrity::Cop
        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-data_integrity-0.2.1 lib/active_record/data_integrity/cop/accordance/table_presence.rb
activerecord-data_integrity-0.1.0 lib/active_record/data_integrity/cop/accordance/table_presence.rb