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.



115
116
117
118
119
# File 'lib/mongoid.rb', line 115

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