README.markdown in mover-0.2.0 vs README.markdown in mover-0.2.1
- old
+ new
@@ -30,18 +30,18 @@
We also want the article's comments to be archived when the article is.
<pre>
class Article < ActiveRecord::Base
has_many :comments
- before_move_to :ArticleArchive do
+ before_move :ArticleArchive do
comments.each { |c| c.move_to(CommentArchive) }
end
end
class ArticleArchive < ActiveRecord::Base
has_many :comments, :class_name => 'CommentArchive', :foreign_key => 'article_id'
- before_move_to :Article do
+ before_move :Article do
comments.each { |c| c.move_to(Comment) }
end
end
class Comment < ActiveRecord::Base
@@ -57,10 +57,12 @@
--------------
Before you create a record, you can "reserve a spot" on a table that you will move the record to later.
<pre>
-ArticleArchive.create(:id => Article.reserve_id)
+archive = ArticleArchive.new
+archive.id = Article.reserve_id
+archive.save
</pre>
Magic columns
-------------
\ No newline at end of file