Validates the options passed to the index macro.
Validate the index specification.
@example Validate the index spec.
Options.validate(Band, name: 1)
@param [ Class ] klass The model class. @param [ Hash ] spec The index specification. @param [ Hash ] options The index options.
@raise [ Errors::InvalidIndex ] If validation failed.
@since 3.0.0
# File lib/mongoid/indexes/validators/options.rb, line 46 def validate(klass, spec, options) validate_spec(klass, spec, options) validate_options(klass, spec, options) end