Module: Mongoid::Config::Validators::Client
- Extended by:
- Client
- Included in:
- Client
- Defined in:
- build/mongoid-7.3/lib/mongoid/config/validators/client.rb
Overview
Validator for client specific configuration.
Constant Summary collapse
- STANDARD =
Standard configuration options.
[ :database, :hosts, :username, :password ].freeze
Instance Method Summary collapse
-
#validate(clients) ⇒ Object
Validate the client configuration.
Instance Method Details
#validate(clients) ⇒ Object
Validate the client configuration.
25 26 27 28 29 30 31 32 33 34 |
# File 'build/mongoid-7.3/lib/mongoid/config/validators/client.rb', line 25 def validate(clients) unless clients.has_key?(:default) raise Errors::NoDefaultClient.new(clients.keys) end clients.each_pair do |name, config| validate_client_database(name, config) validate_client_hosts(name, config) validate_client_uri(name, config) end end |