<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,14 +3,13 @@ Acts As Commentable (now with comment threads (TM)!!!  -- kidding on the (TM))
 
 Allows for threaded comments to be added to multiple and different models.  Drop-in compatible for acts_as_commentable (however requiring a database schema change)
 
-== Installation
+== Resources
 
 This plugin depends on CollectiveIdea's Awesome Nested Set plugin.
 
 You can find the plugin on GitHub:  http://github.com/collectiveidea/awesome_nested_set/tree/master
 
-script/plugin install git://github.com/collectiveidea/awesome_nested_set.git
-
+== Install
 
 Rails
 	* To install as a plugin:
@@ -24,6 +23,7 @@ Merb/Rails
 	
 
 Rails
+
 	* To install from scratch:
 
  	script/generate acts_as_commentable_with_threading_migration 	
@@ -36,26 +36,73 @@ Rails
 
  	This will generate the necessary migration to upgrade your comments table to work with acts_as_commentable_with_threading
 	 	
+ * Create a new rails migration and add the following self.up and self.down methods
+
+ * These are the required fields for the database migration, however you may add any additional fields you need.
+ 
+  def self.up
+    create_table &quot;comments&quot;, :force =&gt; true do |t|
+      t.integer &quot;commentable_id&quot;, :default =&gt; 0
+      t.string &quot;commentable_type&quot;, :limit =&gt; 15, :default =&gt; &quot;&quot;
+      t.text &quot;body&quot;, :default =&gt; &quot;&quot;
+      t.integer &quot;user_id&quot;, :default =&gt; 0, :null =&gt; false
+      t.integer &quot;parent_id&quot;
+      t.integer &quot;lft&quot;
+      t.integer &quot;rgt&quot;
+      t.timestamps
+    end
+  
+    add_index &quot;comments&quot;, &quot;user_id&quot;
+    add_index &quot;comments&quot;, &quot;commentable_id&quot;
+  end
+
+  def self.down
+    drop_table :comments
+  end
 
 == Usage
 
-class Model &lt; ActiveRecord::Base
+class Article &lt; ActiveRecord::Base
 	acts_as_commentable
 end
  
-* Add a comment to a model instance
- 
-model = Model.new
-comment = Comment.new(:model =&gt; model, :body =&gt; &quot;Your comment text here&quot;)
-comment.save!
-comment.move_to_child_of(the_desired_parent_comment)
+ * Add a comment to a model instance, for example an Article
 
-# Following doesn't work/make sense to me. Leaving for historical sake -- Jack
-# * Each comment reference commentable object
-#
-# model = Model.find(1)
-# model.comment_threads.first.commentable == model
+	@article = Article.find(params[:id])
+	@user_who_commented = @current_user
+	@comment = Comment.build_from(@article, @user_who_commented.id, &quot;Hey guys this is my comment!&quot; )
+	
+ * To make a newly created comment into a child/reply of another comment
 
+	comment.move_to_child_of(the_desired_parent_comment)
+	
+ * To retrieve all comments for an article, including child comments
+	
+	@all_comments = @article.comment_threads
+	
+ * To retrieve only the root comments without their children comments
+	
+	@root_comments = @article.root_comments
+	
+ * To check if a comment has children
+
+	@comment.has_children?
+	
+ * To verify the number of children a comment has
+	
+	@comment.children.size
+	
+ * To retrieve a comments children
+
+	@comment.children
+	
+	
+ *If you plan to use the acts_as_voteable plugin with your comment system be sure to uncomment two things:
+
+	in lib/comment.rb uncomment the line &quot;acts_as_voteable&quot;
+	in lib/acts_as_commentable_with_threading.rb uncomment the line &quot;include Juixe::Acts::Voteable&quot; near the top
+	
+ 
 == Credits
 
 Jack Dempsey  - This plugin/gem is heavily influenced/liberally borrowed/stole from acts_as_commentable
@@ -67,4 +114,4 @@ Xelipe - Because acts_as_commentable was heavily influenced by Acts As Taggable.
 == More
 
 http://triple-dog-dare.com
-http://evan.tiggerpalace.com
\ No newline at end of file
+http://evan.tiggerpalace.com</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require 'activerecord'
 require 'awesome_nested_set'
 ActiveRecord::Base.class_eval do
   include CollectiveIdea::Acts::NestedSet
+  #include Juixe::Acts::Voteable   #&lt;-- uncomment this if you have installed and wish to use the acts_as_voteable plugin
 end
 require 'comment'
 
@@ -49,10 +50,16 @@ module Acts #:nodoc:
     
     # This module contains instance methods
     module InstanceMethods
+      
+      # Helper method to display only root threads, no children/replies
+      def root_comments
+        self.comment_threads.find(:all, :conditions =&gt; {:parent_id =&gt; nil})
+      end
+      
       # Helper method to sort comments by date
       def comments_ordered_by_submitted
         Comment.find(:all,
-          :conditions =&gt; [&quot;commentable_id = ? and commentable_type = ?&quot;, id, self.type.name],
+          :conditions =&gt; [&quot;commentable_id = ? and commentable_type = ?&quot;, id, self.class.name],
           :order =&gt; &quot;created_at DESC&quot;
         )
       end</diff>
      <filename>lib/acts_as_commentable_with_threading.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,23 @@ class Comment &lt; ActiveRecord::Base
   # NOTE: Comments belong to a user
   belongs_to :user
   
+  # Helper class method that allows you to build a comment
+  # by passing a commentable object, a user_id, and comment text
+  # example in readme
+  def self.build_from(obj, user_id, comment)
+    c = self.new
+    c.commentable_id = obj.id 
+    c.commentable_type = obj.class.name 
+    c.body = comment 
+    c.user_id = user_id
+    c
+  end
+  
+  #helper method to check if a comment has children
+  def has_children?
+    self.children.size &gt; 0 
+  end
+  
   # Helper class method to lookup all comments assigned
   # to all commentable types for a given user.
   def self.find_comments_by_user(user)</diff>
      <filename>lib/comment.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fd71fa4c85cdc7a4a29f633f4a34ac2c009cfedc</id>
    </parent>
    <parent>
      <id>ae35d034ffa6d751b4a1a2ea7a150897d692e413</id>
    </parent>
  </parents>
  <author>
    <name>Evan David Light</name>
    <email>evan@tiggerpalace.com</email>
  </author>
  <url>http://github.com/elight/acts_as_commentable_with_threading/commit/a2f26cc78ea42f7a5884e34c13895770dd9db9bf</url>
  <id>a2f26cc78ea42f7a5884e34c13895770dd9db9bf</id>
  <committed-date>2009-05-06T11:21:30-07:00</committed-date>
  <authored-date>2009-05-06T11:21:30-07:00</authored-date>
  <message>Merged Casen's changes</message>
  <tree>7dcea9ded5a9fa4702b49d9e87d896e86e90305a</tree>
  <committer>
    <name>Evan David Light</name>
    <email>evan@tiggerpalace.com</email>
  </committer>
</commit>
