123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Traversable::DiscriminatorRetrieval Private

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: lib/mongoid/traversable.rb

Overview

Module used for prepending the discriminator_value method.

A separate module was needed because the subclasses of this class need to be manually prepended with the discriminator_value and can’t rely on being a class_attribute because the .discriminator_value method is overridden by every subclass in the inherited method.

Instance Method Summary

  • #discriminator_value Internal use only

    Get the name on the reading side if the discriminator_value is nil.

Instance Method Details

#discriminator_value

Get the name on the reading side if the discriminator_value is nil

[ GitHub ]

  
# File 'lib/mongoid/traversable.rb', line 175

def discriminator_value
  @discriminator_value || name
end