Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

a few additional examples of navigating revisions.

  • Loading branch information...
commit c514e3ed7706dca7314b6c50cae60cfdc1036500 1 parent 760730f
Rich Cavanaugh authored

Showing 1 changed file with 12 additions and 3 deletions. Show diff stats Hide diff stats

  1. +12 3 README.rdoc
15 README.rdoc
Source Rendered
@@ -37,7 +37,7 @@ This plugin wouldn't exist without Rick Olsen's acts_as_versioned. AAV has been
37 37 * Uses ActiveRecord's dirty attribute tracking.
38 38 * Several ways to find revisions including:
39 39 * revision number
40   - * relative keywords (:previous, :last)
  40 + * relative keywords (:first, :previous and :last)
41 41 * timestamp
42 42 * Reverting
43 43 * Branching
@@ -96,7 +96,7 @@ Some example usage:
96 96 @project.revision_number # => 2
97 97
98 98 Navigating revisions:
99   -
  99 +
100 100 @previous = @project.find_revision(:previous)
101 101 # or
102 102 @previous = @project.revisions.first
@@ -107,7 +107,16 @@ Navigating revisions:
107 107 @previous.revision_name # => "Changed name"
108 108
109 109 @previous.previous.name # => "Rich"
110   - @previous.ancestors.map(&:name) # => ["Rich"]
  110 +
  111 + # Forcing the creation of a new revision.
  112 + @project.updated_attribute("Rogelio")
  113 + @project.revision_number # => 3
  114 +
  115 + @newest = @project.find_revision(:previous)
  116 + @newest.ancestors.map(&:name) # => ["Third", "Rich"]
  117 +
  118 + @oldest = @project.find_revision(:first)
  119 + @oldest.descendants.map(&:name) # => ["Sam", "Third"]
111 120
112 121 Reverting:
113 122

0 comments on commit c514e3e

Please sign in to comment.
Something went wrong with that request. Please try again.