123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::GlobalDiscriminatorKeyAssignment Private

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: lib/mongoid.rb

Overview

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

Instance Attribute Summary

Instance Attribute Details

#discriminator_key=(value) (writeonly)

Sets the global discriminator key name.

Parameters:

  • value (String | Symbol)

    The new discriminator key name.

[ GitHub ]

  
# File 'lib/mongoid.rb', line 161

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