Sha256: d7bcfb7bc04327926116104dd09f722d54af8ef809ef4197a5014cdf565ebe05
Contents?: true
Size: 650 Bytes
Versions: 11
Compression:
Stored size: 650 Bytes
Contents
require 'slack-ruby-bot-server/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 && 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