aq1018/mongoid-history — pull request #75 by joelnordell (2013-06-11 14:48:14+00:00)
Title: add :changes_method option

This option allows, on a per-class basis, an alternate method to be used for history change tracking.

The use case is that I have one class where embedded docs are updated in a funky way (by replacing the entire list of embedded docs with new ones constructed from submitted form params, but the actual field values may or may not have actually been changed).

In that class I've written a full_changes method which includes changes made to the embedded docs (in my domain-specific way). (It doesn't work to just override changes itself, because that breaks other things within Mongoid.) Having this option in Mongoid::History allows my alternate method to be used when it decides whether or not to create a history entry.