<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,3 +7,13 @@ task :asciicasts =&gt; :environment do
     sleep 3 # so we don't hammer the server
   end
 end
+
+desc &quot;Reset position attribute for all comments, sometimes it gets out of sync&quot;
+task :reset_comment_positions =&gt; :environment do
+  Episode.find_each do |episode|
+    episode.comments.all(:order =&gt; &quot;created_at&quot;).each_with_index do |comment, index|
+      puts comment.name + &quot; #{index}&quot;
+      comment.update_attribute(:position, index+1)
+    end
+  end
+end</diff>
      <filename>lib/tasks/application.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ad8da3946ae03634e4816615acb0996ac6f21ce</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </author>
  <url>http://github.com/ryanb/railscasts/commit/9fb89890bba4a9b9e9092d61131a45338361be72</url>
  <id>9fb89890bba4a9b9e9092d61131a45338361be72</id>
  <committed-date>2009-10-28T16:20:47-07:00</committed-date>
  <authored-date>2009-10-28T16:20:47-07:00</authored-date>
  <message>adding rake task to reset all comment positions</message>
  <tree>bccf69d914469e00adc297e13b3afcc22331adb6</tree>
  <committer>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </committer>
</commit>
