jnunemaker/mongomapper — Issue #365: update_attribute shouldn't invoke validations
Author: matthiassiegel
Created: 2011-12-14 13:33:36+00:00
State: open

In ActiveRecord, the purpose of `update_attribute` is to quickly update a single attribute on a record without going through all the validations defined for the model. To achieve that it simply calls `save(:validate => false)`.

In MongoMapper the behaviour of `update_attribute` is different, it only forwards to `update_attributes`, which invokes validations.

My workaround for now is to update the attribute manually instead of using `update_attribute`:

```
item.my_attribute = new_value
item.save(:validate => false)
```

Maybe not a bug, but might save others some debugging time if the behaviour was consistent :)

Thanks
Matthias