Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Version 0.1.1

  • Loading branch information...
commit 87591b720d161dec3aa2570338b22db6ca0ace8c 1 parent 00400aa
@winton authored
Showing with 20 additions and 15 deletions.
  1. +15 −10 README.markdown
  2. +5 −5 acts_as_archive.gemspec
View
25 README.markdown
@@ -20,7 +20,7 @@ rubygems:
sudo gem install winton-acts_as_archive
# environment.rb
-config.gem "winton-acts_as_archive"
+config.gem "winton-acts_as_archive", :lib => "acts_as_archive", :source => "http://gems.github.com"
</pre>
Models
@@ -43,26 +43,31 @@ Next time your Rails instance boots up, the plugin replicates your table's struc
Use <code>destroy</code>, <code>delete</code>, and <code>delete_all</code> like you normally would.
Records are copied into the archive table before being destroyed.
-Archive Model
--------------
+What if my schema changes?
+--------------------------
-Run finds on the archive by adding <code>::Archive</code> to your model:
+Any new migrations on your <code>acts\_as\_archive</code> table are automatically applied to the archive table.
+
+Query the archive
+-----------------
+
+Add <code>::Archive</code> to your ActiveRecord class:
<pre>
Article::Archive.find(:first)
</pre>
-Restore
--------
+Restore from the archive
+------------------------
-Use <code>restore\_all</code> to copy archive records back to your table:
+Use <code>restore\_all</code> to copy archived records back to your table:
-<code>
+<pre>
Article.restore_all([ 'id = ?', 1 ])
-</code>
+</pre>
Auto-migrate from acts\_as\_paranoid
------------------------------------
If a <code>deleted\_at</code> column is present in your table, the plugin will attempt to move deleted
-records to the archive table.
+records to the archive table, preserving the <code>deleted\_at</code> value.
View
10 acts_as_archive.gemspec
@@ -1,14 +1,14 @@
Gem::Specification.new do |s|
s.name = 'acts_as_archive'
- s.version = '0.1.0'
- s.date = '2009-04-22'
+ s.version = '0.1.1'
+ s.date = '2009-04-23'
- s.summary = "Moves your deleted records to a different table"
- s.description = "Moves your deleted records to a different table"
+ s.summary = "Don't delete your records, move them to a different table"
+ s.description = "Don't delete your records, move them to a different table"
s.author = 'Winton Welsh'
s.email = 'mail@wintoni.us'
- s.homepage = 'http://github.com/winton/'
+ s.homepage = 'http://github.com/winton/acts_as_archive'
# = MANIFEST =
s.files = %w[
Please sign in to comment.
Something went wrong with that request. Please try again.