mongoid/mongoid — Issue #1467: metadata field is reserved
Author: christianhellsten
Created: 2011-12-01 15:43:51+00:00
State: open

The following field definition:
``` field :metadata, :type => Hash
```
Will result in this error when trying to set the field to a Hash object:

``` undefined method `path' for {}:Hash
(eval):2:in `method_missing'
(eval):2:in `method_missing'
.../gems/mongoid-2.3.4/lib/mongoid/atomic.rb:210:in `atomic_paths'
.../gems/mongoid-2.3.4/lib/mongoid/atomic.rb:148:in `atomic_selector'
.../gems/mongoid-2.3.4/lib/mongoid/persistence/operations.rb:117:in `selector'
```

For example, with this code:
```doc = Document.first
doc.metadata = {:one => 1} # or doc.update_attribute...
doc.save
```