Simplify code.

This commit is contained in:
Andy Stewart 2010-06-28 11:27:08 +01:00
parent 8521a431b6
commit 424724d678
1 changed files with 2 additions and 2 deletions

View File

@ -87,13 +87,13 @@ module PaperTrail
# change.
version = versions.first :conditions => ['created_at > ?', timestamp],
:order => 'created_at ASC'
version.reify if version
version.try :reify
end
# Returns the object (not a Version) as it was most recently.
def previous_version
last_version = version ? version.previous : versions.last
last_version.reify if last_version
last_version.try :reify
end
# Returns the object (not a Version) as it became next.