Sha256: f1303021cbb1bf8fab57ae7ae10ccf2dc00f5da85a39e99c971b3d198e779bb6

Contents?: true

Size: 718 Bytes

Versions: 2

Compression:

Stored size: 718 Bytes

Contents

module Rack
  class ECG
    module Check
      class MigrationVersion
        def result
          value = ""
          status = "ok"
          begin
            if defined?(ActiveRecord)
              connection = ActiveRecord::Base.connection
              value = connection.select_value("select max(version) from schema_migrations")
            else
              status = "error"
              value = "ActiveRecord not found"
            end
          rescue => e
            status = "error"
            value = e.message
          end

          Result.new(:migration_version, status, value)
        end
      end

      CheckRegistry.instance.register(:migration_version, MigrationVersion)

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-ecg-0.0.4 lib/rack/ecg/check/migration_version.rb
rack-ecg-0.0.3 lib/rack/ecg/check/migration_version.rb