Diffing tables using acts_as_versioned

I’m looking for a solution to read and store the differences between
two updates to a row in my DB.

For example, if a user changes the number of hours they worked after
submitting their timesheet, I want to be able to show a manager the
change they made and then report that adjustment.

From looking at the docs, acts_as_versioned works for versioning a
model and then stepping through previous revisions, but there doesn’t
seem to be a way to compare the differences between two revisions. Am
I wrong in that assumption? If so, can someone point me to the docs I
should be looking at.

If I’m not wrong, is there another plugin available or does anyone
have any suggestions for how to go about implementing a versioning
system in the way I’m looking for.

Thanks.

On 8/14/07, Justin W. [email protected] wrote:

seem to be a way to compare the differences between two revisions. Am
I wrong in that assumption? If so, can someone point me to the docs I
should be looking at.

If I’m not wrong, is there another plugin available or does anyone
have any suggestions for how to go about implementing a versioning
system in the way I’m looking for.

I’ve been using the riff plugin with Lighthouse.

http://tfletcher.com/svn/rails-plugins/riff/

It helps to store a serialized hash of the diffs in the version model
too, otherwise you have to recalculate each time the view is rendered.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

On Aug 14, 2:35 pm, “Rick O.” [email protected] wrote:

I’ve been using the riff plugin with Lighthouse.

http://tfletcher.com/svn/rails-plugins/riff/

It helps to store a serialized hash of the diffs in the version model
too, otherwise you have to recalculate each time the view is rendered.

Awesome plugin suggestion, Rick. Thanks for pointing it out.

  • j

Justin W. wrote:

I’m looking for a solution to read and store the differences between
two updates to a row in my DB.

Great for logs or versioning (which was recently added).

Much more efficient than acts_as_versioned.