Sha256: 949c4c40755c5dfb67252737b8c3d13c6de7e70a94658470f5187cf4175d5d5c
Contents?: true
Size: 640 Bytes
Versions: 11
Compression:
Stored size: 640 Bytes
Contents
require_relative '../../models/team/mongoid.rb' require 'kaminari/grape' require 'mongoid-scroll' module SlackRubyBotServer module DatabaseAdapter def self.check! rc = Mongoid.default_client.command(ping: 1) return if rc&.ok? raise rc.documents.first['error'] || 'Unexpected error.' rescue StandardError => e warn "Error connecting to MongoDB: #{e.message}" raise e end def self.init! # create indexes ::Mongoid::Tasks::Database.create_indexes # silence loggers Mongoid.logger.level = Logger::INFO Mongo::Logger.logger.level = Logger::INFO end end end
Version data entries
11 entries across 11 versions & 1 rubygems