-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
If a document is fetched with limited fields which don't include a field with a default, and then updated, the field with a default is set.
That is:
class Thing
field :field, default: "just the default"
end
thing = Thing.new(field: "not default")
thing.save!
thing2 = Thing.where(_id: thing.id).only(:_id)
thing2.update
thing3 = Thing.find(thing.id)
thing3.field #=> "just the default"