Skip to content

Instantly share code, notes, and snippets.

@sobstel sobstel/comment.rb
Created Mar 11, 2011

What would you like to do?
mongoid: embedded document without object_id
class Comment
include Mongoid::Document
field :name
# do not generate object_id
# for mongoid <=2.0rc7 (in newer mongoid use Mongoid.embedded_object_id = false)
def identify
embedded_in :post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.