Class | Mongoid::Relations::Constraint |
In: |
lib/mongoid/relations/constraint.rb
|
Parent: | Object |
Used for converting foreign key values to the correct type based on the types of ids that the document stores.
@note Durran: The name of this class is this way to match the metadata
getter, and foreign_key was already taken there.
metadata | [R] |
Convert the supplied object to the appropriate type to set as the foreign key for a relation.
@example Convert the object.
constraint.convert("12345")
@param [ Object ] object The object to convert.
@return [ Object ] The object cast to the correct type.
@since 2.0.0.rc.7