Sha256: e8dfff36716bee0e7a9cdf150ae2d0f39d02f784d4cde9f035e4bfa2f768d1d2

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

module StatusCat
  module Checkers
    class ActiveRecord < Base

      def initialize
        @value = "#{config[ :adapter ]}:#{config[ :username ]}@#{config[ :database ]}"

        @status = fail_on_exception do
          ::ActiveRecord::Base.connection.execute( "select max(version) from schema_migrations" )
          nil
        end
      end

      def config
        unless @config
          yaml =  YAML::load( ERB.new( IO.read( File.join( Rails.root, 'config', 'database.yml' ) ) ).result )
          @config = yaml[ Rails.env ].symbolize_keys!
        end
        return @config
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
status_cat-0.0.8 lib/status_cat/checkers/active_record.rb