Module: Mongoid::Relations::Conversions
- Extended by:
- Conversions
- Included in:
- Conversions
- Defined in:
- build/mongoid-6.1/lib/mongoid/relations/conversions.rb
Overview
Contains utility methods for object id conversion.
Instance Method Summary collapse
-
#flag(object, metadata) ⇒ Object
Mark the provided object as unconvertable to bson or not, and always return the provided object.
Instance Method Details
#flag(object, metadata) ⇒ Object
Mark the provided object as unconvertable to bson or not, and always return the provided object.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'build/mongoid-6.1/lib/mongoid/relations/conversions.rb', line 21 def flag(object, ) inverse = .inverse_klass if inverse.using_object_ids? || object.is_a?(BSON::ObjectId) object else if object.is_a?(String) object.unconvertable_to_bson = true end object end end |