Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

versioned rails db and differ

I'm wondering if there's an integrated solution to have a database with versioned records supported by rails (ala version_fu ar_versioned) and a differ thanks!


2 Answers

Check out acts_as_versioned.

like image 96
webmat Avatar answered Dec 30 '25 18:12

webmat


Thanks srboisvert for mentioning my fork. Here's a bit more info/context. The updated_attributes column's value is set for each version, and lists what attributes were changed from the prior version. This is useful when you need to display a record/version and want to show what values changed. I needed this to implement a history view for a particular record we had, where we wanted to color any changed values red in each version we displayed in the history. This is covered in my blog post which is linked above, along with a couple other minor tweaks.

If anyone tweaks it further, please do send me a pull request, etc.

like image 41
chrisrbailey Avatar answered Dec 30 '25 18:12

chrisrbailey