How do you create a copy / dup a mongoid object?

Viewed 6627

ActiveRecord safely supports dup, but mongoid doesn't appear to handle it properly.

I'd like to do the following:

x = MyModel.new
x.save
y = x.dup
y.save

And y should be a totally new object such that:

x != y
x.id != y.id
1 Answers
Related