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.27 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.26 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.25 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.23 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.22 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.21 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.20 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.19 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.18 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.17 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.16 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.15 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.14 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.13 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.12 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.11 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.10 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.9 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.8 lib/workarea/configuration/mongoid.rb
workarea-core-3.5.7 lib/workarea/configuration/mongoid.rb