-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I'm using mongoid 3.1.4.
This causes unexpected validation error, like this
> class Hoge; include Mongoid::Document; field :name, type: String; validates :name, uniqueness: true; end => {:uniqueness=>true} > h = Hoge.new(name: 'foobar') => #<Hoge _id: 51df9674d53e43ebb0000003, created_at: nil, updated_at: nil, deleted_at: nil, name: "foobar", sheet_id: nil, kase_id: nil> > h.upsert => true > h.new_record? => true > h.name = 'piyo' => "piyo" > h.upsert => false