mongoid/mongoid — Issue #1661: validates uniqueness fails while cloning in 2.4.3
Author: sebastianmaier
Created: 2012-01-31 15:19:33+00:00
State: open

```
class ContentElement
include Mongoid::Document
field :title, :type => String

validates :title, :uniqueness => true
end
```

If it test that with this spec

```
describe ContentElement do
it "is only valid with a unique name" do
contentElement1 = ContentElement.create :title => "ups"
contentElement2 = ContentElement.new :title => "ups"
contentElement2.save.should_not be_true
end
describe "#clone" do
it "is only valid with a unique name" do
contentElement1 = ContentElement.create :title => "ups"
contentElement2 = contentElement1.clone
contentElement2.save.should_not be_true
end
end
end
```
First spec is green, but second is red, it says that the clone is valid - but should not be valid.
With 2.3.4 everything was fine, but after updating to 2.4.3 it was broken.