sermo/acts_as_revisionable — pull request #3 by ajvargo (2014-08-11 19:19:50+00:00)
Title: Add before_set_revision callback to options

Instead of doing the 'munge' of passing objects around and trying to get
information off it, this allows an information setting callback.

The use case is attributes that are not database backed, but are wanted
on the version. If the methods provided to 'meta' don't do something
dynamic, the value would get set. Say, something like 'updated_by'.

The previous implementation tried to solve this, but didn't work for
more than one attribute in 'meta'.

The current solution allows a user to set :before_store_revision =>
:my_callback and then call
object.store_revision(some_args) do
...
end

object#my_callback will trigger before the versioning starts:
revisioned_object.send(:my_callback, *some_args)

revisioned_object is *not* the object you are calling 'store_revision'
on. It is the read-only copy that the revision tree is built from.