Module: Mongoid::GlobalDiscriminatorKeyAssignment Private

Included in:
Mongoid
Defined in:
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.

Sets the global discriminator key name.

Parameters:

  • value (String | Symbol)

    The new discriminator key name.



151
152
153
154
155
# File 'lib/mongoid.rb', line 151

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