Method: Mongoid::Relations::Metadata#type_setter

Defined in:
lib/mongoid/relations/metadata.rb

#type_setterString

Gets the setter for the field that sets the type of document on a polymorphic relation.

Examples:

Get the inverse type setter.

.inverse_type_setter

Returns:

  • (String)

    The name of the setter.

Since:

  • 2.0.0.rc.1



688
689
690
# File 'lib/mongoid/relations/metadata.rb', line 688

def type_setter
  @type_setter ||= type ? "#{type}=" : nil
end