Skip to content

Instantly share code, notes, and snippets.

@umar-webonise
Created May 27, 2015 05:30
Show Gist options
  • Save umar-webonise/eb060fb86a3b6f8aac27 to your computer and use it in GitHub Desktop.
Save umar-webonise/eb060fb86a3b6f8aac27 to your computer and use it in GitHub Desktop.
Omiting $oid when coverting to json
# place code in config/initializers/bson.rb
module BSON
class ObjectId
def as_json(*args)
to_s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment