Rails - Vestal Versions - Access previous version data w/o restoring?
- by AnApprentice
Hello, I'd like to use vestal versions to do the following:
Determine the Content of the current record being saved
Determine the Content of the last record saved
In my model I have:
class Note < ActiveRecord::Base
versioned :if => :really_create_a_version?
def really_create_a_version?
XXXXXXXXXXXXXX
XXXXXXXXXXXXXX
end
end
Where the XXXX are, how can I get the note.content of the item about to be saved (i'm assuming it hasn't been saved yet to the DB? Is that correct?
Also, how can I get the note.content of the save before the current save in progress?
Thanks