class Mongoid::Relations::Metadata

Public Instance Methods

inverse_of_field() click to toggle source

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

@example Get the name of the field.

metadata.inverse_of_field

@return [ String ] The name of the field for storing the name of the

inverse field.

@since 2.4.5

# 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_setter() click to toggle source

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

@example Get the inverse type setter.

metadata.inverse_of_field_setter

@return [ String ] The name of the setter.

# 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