<?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"
	>
<channel>
	<title>Comments on: :finder_sql - single vs double quotes</title>
	<atom:link href="http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/</link>
	<description>of Tamer Salama</description>
	<pubDate>Wed, 07 Jan 2009 02:23:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Tamer</title>
		<link>http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/#comment-349</link>
		<dc:creator>Tamer</dc:creator>
		<pubDate>Sat, 02 Jun 2007 17:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/#comment-349</guid>
		<description>The issue was to get the appropriate id in the has_many class method. Instance object id was the required id (not the class object id). Using the double quotes did the trick.</description>
		<content:encoded><![CDATA[<p>The issue was to get the appropriate id in the has_many class method. Instance object id was the required id (not the class object id). Using the double quotes did the trick.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jereme</title>
		<link>http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/#comment-348</link>
		<dc:creator>Jereme</dc:creator>
		<pubDate>Sat, 02 Jun 2007 01:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.tamersalama.com/2007/05/17/finder_sql-single-vs-double-quotes/#comment-348</guid>
		<description>Maybe I'm all hopped up goofballs, or maybe my solution is irrelevant to the context of your syntax usage, but... Can you avoid quoting issues all together in SQL queries via bind vars?

i.e.

has_many :breedtypes, :finder_sql =&#62; ["SELECT Breedtype.* FROM ... WHERE (cai = ?)", id]

Not only does this avoid quoting issues, but it will also handle not quoting integer fields, and will eliminate the possibility of a hot SQL injection ruining the show.

My two pennies...</description>
		<content:encoded><![CDATA[<p>Maybe I&#8217;m all hopped up goofballs, or maybe my solution is irrelevant to the context of your syntax usage, but&#8230; Can you avoid quoting issues all together in SQL queries via bind vars?</p>
<p>i.e.</p>
<p>has_many :breedtypes, :finder_sql =&gt; ["SELECT Breedtype.* FROM ... WHERE (cai = ?)", id]</p>
<p>Not only does this avoid quoting issues, but it will also handle not quoting integer fields, and will eliminate the possibility of a hot SQL injection ruining the show.</p>
<p>My two pennies&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

