Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Versioned#revert convenience method.

  • Loading branch information...
commit b8667bcc2a502c5e6d5964aeac4dd399da902bb7 1 parent 3407fce
Christopher Burnett twoism authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/versioned.rb
8 lib/versioned.rb
View
@@ -126,7 +126,11 @@ def changes_between(from, to)
changes
end
end
-
+
+ def revert
+ revert_to self.version -1
+ end
+
def revert_to(value)
to_number = versions.number_at(value)
changes = changes_between(version, to_number)
@@ -150,4 +154,4 @@ def latest_changes
versions.at(version).changes
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.