dimanche 12 avril 2015

Using Paper Trail to find the user who updated the current version of the model

The project I am working is using the Paper Trail gem to store previous versions of certain models.


I'm using this to display an audit history page on the models view page which shows what was changed between model updates and who changed it. This is working fine for the previous versions, but I would also like to show who updated the current version of the model.


Is there a version of the whodunnit command to find who updated the model to its current state?


I figured Paper Trail must store it somewhere for the current version otherwise it wouldn't know for when it populates the model.versions array on the next update.


I've searched on Stack Overflow and even started looking through the gems code, but I couldn't work out how it stores whodunnit for the current_version.


Aucun commentaire:

Enregistrer un commentaire