Module: Mongoid::Relations::Options
Overview
This module contains the validating logic for options passed to relation macros.
Constant Summary collapse
- COMMON =
These options are available to all relations.
[ :class_name, :extend, :inverse_class_name, :inverse_of, :name, :relation, :validate ]
Instance Method Summary collapse
-
#validate!(options) ⇒ true, false
Determine if the provided options are valid for the relation.
Instance Method Details
#validate!(options) ⇒ true, false
Determine if the provided options are valid for the relation.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/mongoid/relations/options.rb', line 33 def validate!() = [:relation]..concat(COMMON) .keys.each do |key| if !.include?(key) raise Errors::InvalidOptions.new( [:name], key, ) end end end |