This commit is contained in:
Toks
2015-04-15 11:29:15 -04:00
parent 5eb1b1da75
commit ad8e16aabf
3 changed files with 39 additions and 0 deletions

View File

@@ -28,6 +28,10 @@ class NoteVersion < ActiveRecord::Base
self.updater_ip_addr = CurrentUser.ip_addr
end
def previous
NoteVersion.where("note_id = ? and created_at < ?", note_id, created_at).order("created_at desc").first
end
def updater_name
User.id_to_name(updater_id)
end