Skip to content
This repository
Browse code

Version 0.1.1

  • Loading branch information...
commit 87591b720d161dec3aa2570338b22db6ca0ace8c 1 parent 00400aa
Winton Welsh authored

Showing 2 changed files with 20 additions and 15 deletions. Show diff stats Hide diff stats

  1. +15 10 README.markdown
  2. +5 5 acts_as_archive.gemspec
25 README.markdown
Source Rendered
@@ -20,7 +20,7 @@ rubygems:
20 20 sudo gem install winton-acts_as_archive
21 21
22 22 # environment.rb
23   -config.gem "winton-acts_as_archive"
  23 +config.gem "winton-acts_as_archive", :lib => "acts_as_archive", :source => "http://gems.github.com"
24 24 </pre>
25 25
26 26 Models
@@ -43,26 +43,31 @@ Next time your Rails instance boots up, the plugin replicates your table's struc
43 43 Use <code>destroy</code>, <code>delete</code>, and <code>delete_all</code> like you normally would.
44 44 Records are copied into the archive table before being destroyed.
45 45
46   -Archive Model
47   --------------
  46 +What if my schema changes?
  47 +--------------------------
48 48
49   -Run finds on the archive by adding <code>::Archive</code> to your model:
  49 +Any new migrations on your <code>acts\_as\_archive</code> table are automatically applied to the archive table.
  50 +
  51 +Query the archive
  52 +-----------------
  53 +
  54 +Add <code>::Archive</code> to your ActiveRecord class:
50 55
51 56 <pre>
52 57 Article::Archive.find(:first)
53 58 </pre>
54 59
55   -Restore
56   --------
  60 +Restore from the archive
  61 +------------------------
57 62
58   -Use <code>restore\_all</code> to copy archive records back to your table:
  63 +Use <code>restore\_all</code> to copy archived records back to your table:
59 64
60   -<code>
  65 +<pre>
61 66 Article.restore_all([ 'id = ?', 1 ])
62   -</code>
  67 +</pre>
63 68
64 69 Auto-migrate from acts\_as\_paranoid
65 70 ------------------------------------
66 71
67 72 If a <code>deleted\_at</code> column is present in your table, the plugin will attempt to move deleted
68   -records to the archive table.
  73 +records to the archive table, preserving the <code>deleted\_at</code> value.
10 acts_as_archive.gemspec
... ... @@ -1,14 +1,14 @@
1 1 Gem::Specification.new do |s|
2 2 s.name = 'acts_as_archive'
3   - s.version = '0.1.0'
4   - s.date = '2009-04-22'
  3 + s.version = '0.1.1'
  4 + s.date = '2009-04-23'
5 5
6   - s.summary = "Moves your deleted records to a different table"
7   - s.description = "Moves your deleted records to a different table"
  6 + s.summary = "Don't delete your records, move them to a different table"
  7 + s.description = "Don't delete your records, move them to a different table"
8 8
9 9 s.author = 'Winton Welsh'
10 10 s.email = 'mail@wintoni.us'
11   - s.homepage = 'http://github.com/winton/'
  11 + s.homepage = 'http://github.com/winton/acts_as_archive'
12 12
13 13 # = MANIFEST =
14 14 s.files = %w[

0 comments on commit 87591b7

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