lib/paper_trail/version.rb in paper_trail-1.5.1 vs lib/paper_trail/version.rb in paper_trail-1.5.2
- old
+ new
@@ -38,10 +38,21 @@
model.version = self
model
end
end
+ # Returns who put the item into the state stored in this version.
+ def originator
+ previous.try :whodunnit
+ end
+
+ # Returns who changed the item from the state it had in this version.
+ # This is an alias for `whodunnit`.
+ def terminator
+ whodunnit
+ end
+
def next
Version.first :conditions => ["id > ? AND item_type = ? AND item_id = ?", id, item_type, item_id],
:order => 'id ASC'
end
@@ -52,7 +63,7 @@
def index
Version.all(:conditions => ["item_type = ? AND item_id = ?", item_type, item_id],
:order => 'id ASC').index(self)
end
-
+
end