<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -91,7 +91,7 @@ class Pitch &lt; NewsItem
     end
   end
   has_many :supporters, :through =&gt; :donations, :source =&gt; :user, :order =&gt; &quot;donations.created_at&quot;, :uniq =&gt; true
-  has_many :posts do
+  has_many :posts, :dependent =&gt; :destroy do
     def first(number)
       find(:all, :limit =&gt; number, :order =&gt; 'created_at DESC')
     end</diff>
      <filename>app/models/pitch.rb</filename>
    </modified>
    <modified>
      <diff>@@ -878,5 +878,15 @@ describe Pitch do
       @pitch.donating_groups.should_not include(nil)
     end
   end
+
+  describe &quot;Remove blog posts with pitches&quot; do
+    it &quot;posts are dependent destroy&quot; do
+      pitch = active_pitch
+      post = stub('post')
+      pitch.stub!(:posts).and_return([post])
+      post.should_receive(:destroy)
+      pitch.destroy
+    end
+  end
 end
 </diff>
      <filename>spec/models/pitch_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0b9020158367bfeb19b2dc8cae4fb979d43d9a0b</id>
    </parent>
  </parents>
  <author>
    <name>Les Hill</name>
    <email>leshill@gmail.com</email>
  </author>
  <url>http://github.com/spot-us/spot-us/commit/f585f85fd661d2588836460b562ee51014249807</url>
  <id>f585f85fd661d2588836460b562ee51014249807</id>
  <committed-date>2009-06-22T08:31:10-07:00</committed-date>
  <authored-date>2009-06-22T08:31:10-07:00</authored-date>
  <message>Creat a blog post bug (774727)</message>
  <tree>e44b4a37aac9dae7ec774a9ab552e867040e98e4</tree>
  <committer>
    <name>Les Hill</name>
    <email>leshill@gmail.com</email>
  </committer>
</commit>
