artha42/mm-versionable — pull request #11 by aaronrussell (2012-10-31 15:08:16+00:00)
Title: Saving a version without saving the model should be able to rollback to the latest version

If a saved object has an attribute with a nil value, and then you change that attribute and save a version without saving the model, `rollback(:latest)` should restore the latest version with the updated attribute.

In the `rollback` method, `self.attributes.keys` won't include the attributes with a nil value, so the values from the latest version won't be rolled back.

See https://github.com/aaronrussell/mm-versionable/blob/744427353f3400394eb823fb09c8c0eb44052cb8/lib/versionable/plugins/versionable.rb#L93 for solution.

Test added.