Module: Mongoid::Relations::Conversions
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 'lib/mongoid/relations/conversions.rb', line 21 def flag(object, ) inverse = .inverse_klass if inverse.using_object_ids? || object.is_a?(Moped::BSON::ObjectId) object else if object.is_a?(String) object.unconvertable_to_bson = true end object end end |