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, :counter_cache, :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.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mongoid/relations/options.rb', line 34 def validate!() = [:relation]..concat(COMMON) .keys.each do |key| if !.include?(key) raise Errors::InvalidOptions.new( [:name], key, ) end end end |