<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>README</filename>
    </added>
    <added>
      <filename>RUNNING_UNIT_TESTS</filename>
    </added>
    <added>
      <filename>Rakefile</filename>
    </added>
    <added>
      <filename>test/abstract_unit.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/activerecord_versioned.sqlite</filename>
    </added>
    <added>
      <filename>test/fixtures/activerecord_versioned.sqlite3</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/mysql.drop.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/mysql.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/postgresql.drop.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/postgresql.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/sqlite.drop.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/db_definitions/sqlite.sql</filename>
    </added>
    <added>
      <filename>test/fixtures/locked_pages.yml</filename>
    </added>
    <added>
      <filename>test/fixtures/locked_pages_revisions.yml</filename>
    </added>
    <added>
      <filename>test/fixtures/migrations/1_add_versioned_tables.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/page.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/page_versions.yml</filename>
    </added>
    <added>
      <filename>test/fixtures/pages.yml</filename>
    </added>
    <added>
      <filename>test/migration_test.rb</filename>
    </added>
    <added>
      <filename>test/versioned_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+*0.1.1*
+
+* Adding tests and rdocs
+
 *0.1* 
 
 * Initial transfer from Rails ticket: http://dev.rubyonrails.com/ticket/1974
\ No newline at end of file</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,57 +1,59 @@
-#Copyright (c) 2005 Rick Olson
-#
-#Permission is hereby granted, free of charge, to any person obtaining
-#a copy of this software and associated documentation files (the
-#&quot;Software&quot;), to deal in the Software without restriction, including
-#without limitation the rights to use, copy, modify, merge, publish,
-#distribute, sublicense, and/or sell copies of the Software, and to
-#permit persons to whom the Software is furnished to do so, subject to
-#the following conditions:
-#
-#The above copyright notice and this permission notice shall be
-#included in all copies or substantial portions of the Software.
-#
-#THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
-#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-#NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-#LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-#OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-#WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+# Copyright (c) 2005 Rick Olson
+# 
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# &quot;Software&quot;), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+# 
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-module ActiveRecord
+module ActiveRecord #:nodoc:
   module Acts #:nodoc:
-    module Versioned #:nodoc:
+    # Specify this act if you want to save a copy of the row in a versioned table.  This assumes there is a 
+    # versioned table ready and that your model has a version field.  This works with optimisic locking if the lock_version
+    # column is present as well.
+    #
+    #   class Page &lt; ActiveRecord::Base
+    #     # assumes pages_versions table
+    #     acts_as_versioned
+    #   end
+    #
+    # Example:
+    #
+    #   page = Page.create(:title =&gt; 'hello world!')
+    #   page.version       # =&gt; 1
+    #
+    #   page.title = 'hello world'
+    #   page.save
+    #   page.version       # =&gt; 2
+    #   page.versions.size # =&gt; 2
+    #
+    #   page.revert_to(1)  # using version number
+    #   page.title         # =&gt; 'hello world!'
+    #
+    #   page.revert_to(page.versions.last) # using versioned instance
+    #   page.title         # =&gt; 'hello world'
+    #
+    # See ActiveRecord::Acts::Versioned::ClassMethods#acts_as_versioned for configuration options
+    module Versioned
       def self.included(base) # :nodoc:
         base.extend ClassMethods
       end
 
-      # Specify this act if you want to save a copy of the row in a versioned table.  This assumes there is a 
-      # versioned table ready and that your model has a version field.  This works with optimisic locking if the lock_version
-      # column is present as well.
-      #
-      #   class Page &lt; ActiveRecord::Base
-      #     # assumes pages_versions table
-      #     acts_as_versioned
-      #   end
-      #
-      #   Example:
-      #
-      #   page = Page.create(:title =&gt; 'hello world!')
-      #   page.version       # =&gt; 1
-      #
-      #   page.title = 'hello world'
-      #   page.save
-      #   page.version       # =&gt; 2
-      #   page.versions.size # =&gt; 2
-      #
-      #   page.revert_to(1)  # using version number
-      #   page.title         # =&gt; 'hello world!'
-      #
-      #   page.revert_to(page.versions.last) # using versioned instance
-      #   page.title         # =&gt; 'hello world'
       module ClassMethods
-        # Configuration options are:
+        # == Configuration options
         #
         # * &lt;tt&gt;class_name&lt;/tt&gt; - versioned model class name (default: PageVersion in the above example)
         # * &lt;tt&gt;table_name&lt;/tt&gt; - versioned model table name (default: page_versions in the above example)
@@ -60,20 +62,44 @@ module ActiveRecord
         # * &lt;tt&gt;version_column&lt;/tt&gt; - name of the column in the model that keeps the version number (default: version)
         # * &lt;tt&gt;limit&lt;/tt&gt; - number of revisions to keep, defaults to unlimited
         # * &lt;tt&gt;if&lt;/tt&gt; - symbol of method to check before saving a new version.  If this method returns false, a new version is not saved.
-        #       For finer control, pass either a Proc or modify Model#version_condition_met?
+        #   For finer control, pass either a Proc or modify Model#version_condition_met?
         #
-        #         acts_as_versioned :if =&gt; Proc.new { |auction| !auction.expired? }
+        #     acts_as_versioned :if =&gt; Proc.new { |auction| !auction.expired? }
         #
-        #         or...
+        #   or...
         #
-        #         class Auction
-        #           def version_condition_met? # totally bypasses the &lt;tt&gt;:if&lt;/tt&gt; option
-        #             !expired?
-        #           end
-        #         end
+        #     class Auction
+        #       def version_condition_met? # totally bypasses the &lt;tt&gt;:if&lt;/tt&gt; option
+        #         !expired?
+        #       end
+        #     end
         #
         # * &lt;tt&gt;if_changed&lt;/tt&gt; - Simple way of specifying attributes that are required to be changed before saving a model.  This takes
-        #       either a symbol or array of symbols.
+        #   either a symbol or array of symbols.
+        #
+        # == Database Schema
+        #
+        # The model that you're versioning needs to have a 'version' attribute. The model is versioned 
+        # into a table called #{model}_versions where the model name is singlular. The _versions table should 
+        # contain all the fields you want versioned, the same version column, and a #{model}_id foreign key field.
+        #
+        # A lock_version field is also accepted if your model uses Optimistic Locking.  If your table uses Single Table inheritance,
+        # then that field is reflected in the versioned model as 'versioned_type' by default.
+        #
+        # Acts_as_versioned comes prepared with the ActiveRecord::Acts::Versioned::ActMethods::ClassMethods#create_versioned_table 
+        # method, perfect for a migration.  It will also create the version column if the main model does not already have it.
+        #
+        #   class AddVersions &lt; ActiveRecord::Migration
+        #     def self.up
+        #       # create_versioned_table takes the same options hash
+        #       # that create_table does
+        #       Post.create_versioned_table
+        #     end
+        #   
+        #     def self.down
+        #       Post.drop_versioned_table
+        #     end
+        #   end
         def acts_as_versioned(options = {})
           # don't allow multiple calls
           return if defined?(self.versioned_class_name)
@@ -262,17 +288,26 @@ module ActiveRecord
         unless defined?(ACTS_AS_VERSIONED_CALLBACKS)
           ACTS_AS_VERSIONED_CALLBACKS =  [:set_new_version, :save_version_on_create, :save_version, :clear_changed_attributes]
         end
+
+        ACTS_AS_VERSIONED_CALLBACKS.each do |attr_name| 
+          alias_method &quot;orig_#{attr_name}&quot;.to_sym, attr_name
+        end
         
-        ACTS_AS_VERSIONED_CALLBACKS.each { |attr_name| alias_method &quot;orig_#{attr_name}&quot;.to_sym, attr_name }
-        def empty_callback() end
+        def empty_callback() end #:nodoc:
+
         def enable_acts_as_versioned_callbacks
           self.class.class_eval do 
-            ACTS_AS_VERSIONED_CALLBACKS.each { |attr_name| alias_method attr_name, &quot;orig_#{attr_name}&quot;.to_sym }
+            ACTS_AS_VERSIONED_CALLBACKS.each do |attr_name|
+              alias_method attr_name, &quot;orig_#{attr_name}&quot;.to_sym
+            end
           end
         end
+
         def disable_acts_as_versioned_callbacks
           self.class.class_eval do 
-            ACTS_AS_VERSIONED_CALLBACKS.each { |attr_name| alias_method attr_name, :empty_callback }
+            ACTS_AS_VERSIONED_CALLBACKS.each do |attr_name| 
+              alias_method attr_name, :empty_callback
+            end
           end
         end
 </diff>
      <filename>lib/acts_as_versioned.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
-# coming soon
\ No newline at end of file
+$:.unshift &quot;../lib&quot;
+Dir[&quot;**/*_test.rb&quot;].each { |f| load f }
\ No newline at end of file</diff>
      <filename>test/tests.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>acts_as_versioned.gemspec</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>2bd26b98d1dcc235aaadb48a4110ac411e1878b2</id>
    </parent>
  </parents>
  <author>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </author>
  <url>http://github.com/technoweenie/acts_as_versioned/commit/d27c6c6f636cfa7d8c84336cca5ca369ec79b728</url>
  <id>d27c6c6f636cfa7d8c84336cca5ca369ec79b728</id>
  <committed-date>2005-09-17T11:15:49-07:00</committed-date>
  <authored-date>2005-09-17T11:15:49-07:00</authored-date>
  <message>added tests and rdocs

git-svn-id: http://svn.techno-weenie.net/projects/acts_as_versioned@77 567b1171-46fb-0310-a4c9-b4bef9110e78</message>
  <tree>2bc601134dcfd0d41af1971a006f7f6fbb8e75ac</tree>
  <committer>
    <name>technoweenie</name>
    <email>technoweenie@567b1171-46fb-0310-a4c9-b4bef9110e78</email>
  </committer>
</commit>
