Sha256: f19f84ea0c7287789ac637043a48c5de49dbe5da2b4c2e91503ad1fc19af1504

Contents?: true

Size: 541 Bytes

Versions: 28

Compression:

Stored size: 541 Bytes

Contents

module Workarea
  module Configuration
    module Mongoid
      extend self

      def load
        ::Mongoid::Config.load_configuration(
          clients: {
            default: MongoidClient.new.to_h,
            metrics: MongoidClient.new(:metrics).to_h
          }
        )
      end

      def indexes_enforced?
        client = ::Mongoid::Clients.default.use('admin')
        result = client.command(getParameter: 1, notablescan: nil)
        client.close

        !!result.documents.first['notablescan']
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.6 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.5 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.4 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.3 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.2 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.1 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.0 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.0.beta.1 lib/workarea/configuration/mongoid.rb