Module: Mongoid::Config::Validators::Client
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.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mongoid/config/validators/client.rb', line 21 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 |