module Mongoid::Indexes::Validators::Options

Validates the options passed to the index macro.

Constants

VALID_OPTIONS
VALID_TYPES

Public Instance Methods

validate(klass, spec, options) click to toggle source

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