Sha256: cc233be7217a28a6d02e34290134ffb2b00cddbf4f105842dd4a019951c6f1e1
Contents?: true
Size: 703 Bytes
Versions: 28
Compression:
Stored size: 703 Bytes
Contents
module Marty::Diagnostic::Database def self.db_name ActiveRecord::Base.connection_config[:database] end def self.db_server_name ActiveRecord::Base.connection_config[:host] || 'undefined' end def self.db_adapter_name ActiveRecord::Base.connection.adapter_name end def self.db_time ActiveRecord::Base.connection.execute('SELECT NOW();')[0]['now'] end def self.db_version ActiveRecord::Base.connection.execute('SELECT VERSION();')[0]['version'] end def self.db_schema current = ActiveRecord::Migrator.current_version raise "Migration is needed.\nCurrent Version: #{current}" if ActiveRecord::Migrator.needs_migration? current.to_s end end
Version data entries
28 entries across 28 versions & 1 rubygems