Module: Mongoid::GlobalDiscriminatorKeyAssignment Private

Included in:
Mongoid
Defined in:
build/mongoid-7.3/lib/mongoid.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module used to prepend the discriminator key assignment function to change the value assigned to the discriminator key to a string.

Defined Under Namespace

Classes: InvalidFieldHost

Instance Method Summary collapse

Instance Method Details

#discriminator_key=(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



128
129
130
131
132
# File 'build/mongoid-7.3/lib/mongoid.rb', line 128

def discriminator_key=(value)
  Mongoid::Fields::Validators::Macro.validate_field_name(InvalidFieldHost, value)
  value = value.to_s
  super
end