Sha256: 7c89b0facb07188a2cc6c45ee5389ba1fc0894ec7c11c1f9523e7be562e2e88b

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module DataIntegrity
    # Checking cop base class
    class Cop
      attr_reader :model
      delegate :connection, to: :model

      def initialize(model)
        @model = model
      end

      def self.cop_name
        name.gsub('ActiveRecord::DataIntegrity::', '').gsub('::', '/')
      end

      def log(msg)
        ActiveRecord::DataIntegrity::Collector.log(self, msg)
      end

      def progress(subresult, false_char = 'E')
        ActiveRecord::DataIntegrity::Collector.progress(
          self,
          subresult ? Rainbow('.').green : Rainbow(false_char).red
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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