Sha256: fcb79123d3e6764499c126c49d5efaef7ef19ccae199da03ad37f3a3a2a71b51

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

module StatusCat
  module Checkers
    class ActiveRecord < Base

      def initialize
        @value = "#{adapter}:#{username}@#{database}"
        @status = fail_on_exception { test }
      end

      def test
        ::ActiveRecord::Base.connection.execute('select max(version) from schema_migrations')
        return nil
      end

      def config
        return ::ActiveRecord::Base.connection_config
      end

      def adapter
        return config[:adapter]
      end

      def database
        return config[:database]
      end

      def username
        return config[:username]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
status_cat-5.2.1 lib/status_cat/checkers/active_record.rb
status_cat-5.2.0 lib/status_cat/checkers/active_record.rb
status_cat-5.0.2 lib/status_cat/checkers/active_record.rb
status_cat-5.0.1 lib/status_cat/checkers/active_record.rb
status_cat-5.0.0 lib/status_cat/checkers/active_record.rb