mongoid/mongoid — Issue #1500: Can't save nil attributes to existing record (only new records).
Author: edlebert
Created: 2011-12-14 22:17:23+00:00
State: open

I must be doing something wrong. I've tried everything, but nothing I do makes that nil attribute stick. I'm running 2.0.1. I searched the bugs and couldn't find anything like it.

```ruby
class Record
include Mongoid::Document
end

# This works
record = Record.new(:attribute_a => nil)
record.save!
record.reload.attributes # {:attribute_a => nil}

# This doesn't
record[:attribute_b] = nil
record.save!
record.reload.attributes # {:attribute_a => nil}
```