<?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: Using belongs_to in Rails model validations when the parent is unsaved</title>
	<atom:link href="http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/feed/" rel="self" type="application/rss+xml" />
	<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/</link>
	<description>Technical Wizardry, Rants, and just a Whiff of Insanity</description>
	<lastBuildDate>Tue, 13 Jul 2010 19:05:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Jens</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-6863</link>
		<dc:creator>Jens</dc:creator>
		<pubDate>Tue, 13 Jul 2010 19:05:16 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-6863</guid>
		<description>Thanks! I&#039;ll try this ASAP. A first experiment seems to work without side effects. -Jens</description>
		<content:encoded><![CDATA[<p>Thanks! I&#8217;ll try this ASAP. A first experiment seems to work without side effects. -Jens</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mack Earnhardt</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-6841</link>
		<dc:creator>Mack Earnhardt</dc:creator>
		<pubDate>Sun, 11 Jul 2010 15:44:50 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-6841</guid>
		<description>Jen, try this tweak:

ObjectSpace.each_object(Order) {&#124;o&#124; parent_order = o if o.new_record? &amp;&amp; o.line_items.include?(self)}</description>
		<content:encoded><![CDATA[<p>Jen, try this tweak:</p>
<p>ObjectSpace.each_object(Order) {|o| parent_order = o if o.new_record? &#038;&#038; o.line_items.include?(self)}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jens</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-6746</link>
		<dc:creator>Jens</dc:creator>
		<pubDate>Sun, 27 Jun 2010 08:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-6746</guid>
		<description>Hi,

your method works, but it triggers hundreds (in my case) of superfluous SQL requests due to the &quot;.include?&quot; statement like &quot;SELECT child.id FROM children WHERE (child.id = NULL) AND (child.parent_id = xxx)&quot;.

Is there a way to avoid these requests?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>your method works, but it triggers hundreds (in my case) of superfluous SQL requests due to the &#8220;.include?&#8221; statement like &#8220;SELECT child.id FROM children WHERE (child.id = NULL) AND (child.parent_id = xxx)&#8221;.</p>
<p>Is there a way to avoid these requests?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: calebhc</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-6306</link>
		<dc:creator>calebhc</dc:creator>
		<pubDate>Tue, 27 Apr 2010 20:06:11 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-6306</guid>
		<description>Thanks for posting this!</description>
		<content:encoded><![CDATA[<p>Thanks for posting this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Boling</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-1269</link>
		<dc:creator>Peter Boling</dc:creator>
		<pubDate>Sat, 01 Nov 2008 22:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-1269</guid>
		<description>Mack,
Was just googling you and it&#039;s interesting that we are doing the same thing!
How long have you been working with rails?

Do you have any open source projects?
Are still around Indy?  Actually I now remember seeing BW3s on your twitter, so I guess so.   Have you been to any of the iRug meetings? They&#039;re excellent!

- Peter Boling</description>
		<content:encoded><![CDATA[<p>Mack,<br />
Was just googling you and it&#8217;s interesting that we are doing the same thing!<br />
How long have you been working with rails?</p>
<p>Do you have any open source projects?<br />
Are still around Indy?  Actually I now remember seeing BW3s on your twitter, so I guess so.   Have you been to any of the iRug meetings? They&#8217;re excellent!</p>
<p>- Peter Boling</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mack Earnhardt</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-870</link>
		<dc:creator>Mack Earnhardt</dc:creator>
		<pubDate>Sun, 28 Sep 2008 22:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-870</guid>
		<description>I haven&#039;t needed to revisit this, so I really can&#039;t say.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t needed to revisit this, so I really can&#8217;t say.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-840</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 26 Sep 2008 19:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-840</guid>
		<description>Do you still consider this the best way to do this? I&#039;m in a strikingly similar situation...</description>
		<content:encoded><![CDATA[<p>Do you still consider this the best way to do this? I&#8217;m in a strikingly similar situation&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vint</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-506</link>
		<dc:creator>vint</dc:creator>
		<pubDate>Mon, 01 Sep 2008 09:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-506</guid>
		<description>Thanks, very useful!</description>
		<content:encoded><![CDATA[<p>Thanks, very useful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiffani</title>
		<link>http://macksmind.net/2008/04/26/using-belongs_to-in-rails-model-validations-when-the-parent-is-unsaved/comment-page-1/#comment-38</link>
		<dc:creator>Tiffani</dc:creator>
		<pubDate>Fri, 20 Jun 2008 07:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://macksmind.net/?p=10#comment-38</guid>
		<description>Heyy...this was definitely a great blog post!  &#039;twas exactly what I needed when I thought I was really creating something rather screwy.</description>
		<content:encoded><![CDATA[<p>Heyy&#8230;this was definitely a great blog post!  &#8217;twas exactly what I needed when I thought I was really creating something rather screwy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
