Class: BSON::ObjectId
- Inherits:
-
Object
- Object
- BSON::ObjectId
- Defined in:
- lib/mongoid/extensions.rb
Instance Method Summary collapse
-
#as_json(*args) ⇒ String
Return a string representation of the object id for use in application-level JSON serialization.
- #bson_ruby_as_json ⇒ Object
Instance Method Details
#as_json(*args) ⇒ String
Return a string representation of the object id for use in application-level JSON serialization.
13 14 15 16 17 18 19 |
# File 'lib/mongoid/extensions.rb', line 13 def as_json(*args) if Mongoid.object_id_as_json_oid { "$oid" => to_s } else bson_ruby_as_json(*args) end end |
#bson_ruby_as_json ⇒ Object
4 |
# File 'lib/mongoid/extensions.rb', line 4 alias :bson_ruby_as_json :as_json |