<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to delete a many-to-many association with Rails</title>
	<atom:link href="http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/</link>
	<description>projects, programming, blogging...</description>
	<lastBuildDate>Tue, 27 Dec 2011 00:01:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ruby on Rails, why foreign keys matter &#171; Il connettivo</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-391</link>
		<dc:creator>Ruby on Rails, why foreign keys matter &#171; Il connettivo</dc:creator>
		<pubDate>Fri, 12 Aug 2011 13:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-391</guid>
		<description>[...] to delete a object in that kind of association follow the instructions in this post. In short: post.authors.clear (which deletes the association) and post.delete   [...]</description>
		<content:encoded><![CDATA[<p>[...] to delete a object in that kind of association follow the instructions in this post. In short: post.authors.clear (which deletes the association) and post.delete   [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: di97msgd</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-16</link>
		<dc:creator>di97msgd</dc:creator>
		<pubDate>Thu, 12 Aug 2010 09:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-16</guid>
		<description>matt.
:dependent =&gt; :destroy is not a valid option for has_and_belongs_to_many that this article was about.</description>
		<content:encoded><![CDATA[<p>matt.<br />
:dependent =&gt; :destroy is not a valid option for has_and_belongs_to_many that this article was about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Glasgow</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-14</link>
		<dc:creator>Thomas Glasgow</dc:creator>
		<pubDate>Mon, 08 Mar 2010 21:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-14</guid>
		<description>Thank you for the tip, I was just wondering how to remove associations.

Cheers,</description>
		<content:encoded><![CDATA[<p>Thank you for the tip, I was just wondering how to remove associations.</p>
<p>Cheers,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-13</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Fri, 05 Mar 2010 07:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-13</guid>
		<description>Thanks for the post - deleting associations is also not made very clear by the rails API.

@remkade -- just to add that before_destroy { &#124;post&#124; &lt;a href=&quot;post.categories.destr&quot; rel=&quot;nofollow&quot;&gt;post.categories.destr&lt;/a&gt;oy_all} isn&#039;t really necessary if you use the :dependent option when you first associate the objects.

Like so:

  has_many  :feed_entries, :dependent =&gt; :destroy # which will destroy all associated objects whenever the feed itself is destroyed.

:dependent also has a bunch of options besides destroy.</description>
		<content:encoded><![CDATA[<p>Thanks for the post &#8211; deleting associations is also not made very clear by the rails API.</p>
<p>@remkade &#8212; just to add that before_destroy { |post| <a href="post.categories.destr" rel="nofollow">post.categories.destr</a>oy_all} isn&#8217;t really necessary if you use the :dependent option when you first associate the objects.</p>
<p>Like so:</p>
<p>  has_many  :feed_entries, :dependent =&gt; :destroy # which will destroy all associated objects whenever the feed itself is destroyed.</p>
<p>:dependent also has a bunch of options besides destroy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: remkade</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-12</link>
		<dc:creator>remkade</dc:creator>
		<pubDate>Fri, 26 Jun 2009 21:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-12</guid>
		<description>You can also do this in your model:

before_destroy { &#124;post&#124; &lt;a href=&quot;post.categories.destr&quot; rel=&quot;nofollow&quot;&gt;post.categories.destr&lt;/a&gt;oy_all }

Which is much easier I think.</description>
		<content:encoded><![CDATA[<p>You can also do this in your model:</p>
<p>before_destroy { |post| <a href="post.categories.destr" rel="nofollow">post.categories.destr</a>oy_all }</p>
<p>Which is much easier I think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorgegorka</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-11</link>
		<dc:creator>Jorgegorka</dc:creator>
		<pubDate>Sat, 02 Aug 2008 13:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-11</guid>
		<description>Indeed, it&#039;s an important subject that has been sistematically ommited in what should be The Book about rails:  Agile web development with rails.

Thank you very much for the post and the clear explanation.</description>
		<content:encoded><![CDATA[<p>Indeed, it&#8217;s an important subject that has been sistematically ommited in what should be The Book about rails:  Agile web development with rails.</p>
<p>Thank you very much for the post and the clear explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zoran</title>
		<link>http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/#comment-10</link>
		<dc:creator>Zoran</dc:creator>
		<pubDate>Tue, 08 Apr 2008 22:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://how-to-delete-a-many-to-many-association-with-rails#comment-10</guid>
		<description>Thank you so much for this!</description>
		<content:encoded><![CDATA[<p>Thank you so much for this!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

