Skip to content

Instantly share code, notes, and snippets.

@jasiek
Created May 24, 2012 15:03
Show Gist options
  • Select an option

  • Save jasiek/2782093 to your computer and use it in GitHub Desktop.

Select an option

Save jasiek/2782093 to your computer and use it in GitHub Desktop.
class Post
include Mongoid::Document
include Mongoid::Timestamps
identity :type => String
field :title, :type => String
field :body, :type => String
end
class Mongoid::Identity
Generator = Prime.instance.each
def generate_id
Generator.next
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment