Class: Mongoid::Relations::Metadata

Inherits:
Hash
  • Object
show all
Defined in:
lib/mongoid-multiple-polymorphic/mongoid/relations/metadata.rb

Instance Method Summary collapse

Instance Method Details

#inverse_of_fieldString

Returns the name of the field in which to store the name of the inverse field for the polymorphic relation.

Examples:

Get the name of the field.

.inverse_of_field

Returns:

  • (String)

    The name of the field for storing the name of the inverse field.

Since:

  • 2.4.5



14
15
16
# File 'lib/mongoid-multiple-polymorphic/mongoid/relations/metadata.rb', line 14

def inverse_of_field
  @inverse_of_field ||= determine_inverse_for(:field)
end

#inverse_of_field_setterString

Gets the setter for the field that stores the name of the inverse field on a polymorphic relation.

Examples:

Get the inverse type setter.

.inverse_of_field_setter

Returns:

  • (String)

    The name of the setter.



25
26
27
# File 'lib/mongoid-multiple-polymorphic/mongoid/relations/metadata.rb', line 25

def inverse_of_field_setter
  @inverse_of_field_setter ||= inverse_of_field.__setter__
end