aq1018/mongoid-history — pull request #34 by tcopple (2012-04-30 22:15:42+00:00)
Title: Updating Trackable::association_hash to write through parent.

Currently there are cases (on destroy mianly) where an child document
would write it's class name to the association_hash 'name' field. This
happens when it fails to lookup the relationship meta information pertaining to it's
parent OR when the child has been deleted off the parent record before
the destroy history track has been written.

Then if you are trying to use that history track later on, it would fail
the to be able to lookup it's trackable_parent, among other methods,
because it would try to traverse a relationship titled "Comment"
instead of the actual name of teh association, 'comments'.

This fix makes it so a child document doesn't fail to lookup the name of
the relation, when a parent is present, regardless of when the delete
occurs.