<?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: Executing raw SQL in Rails.</title>
	<atom:link href="http://www.rabbitcreative.com/2007/06/08/executing-raw-sql-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rabbitcreative.com/2007/06/08/executing-raw-sql-in-rails/</link>
	<description>ruby, rails, objects and &#60;del&#62;politics&#60;/del&#62; markets</description>
	<lastBuildDate>Wed, 16 Dec 2009 21:48:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: will</title>
		<link>http://www.rabbitcreative.com/2007/06/08/executing-raw-sql-in-rails/comment-page-1/#comment-2406</link>
		<dc:creator>will</dc:creator>
		<pubDate>Mon, 31 Mar 2008 11:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rabbitcreative.com/2007/06/08/executing-raw-sql-in-rails/#comment-2406</guid>
		<description>thanks. very useful pointer. 

there are nicer ways than execute, btw: you can use any of the other connection methods. This is how I get a list of matching tags for an ajax autocompleter:

Tag.connection.select_values(&quot;SELECT name FROM #{Tag.table_name} where account_id = #{current_account.id} and name like &#039;#{params[:stem]}%&#039;&quot;)

Nasty, but efficient. More possibilities at http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html

best,

will</description>
		<content:encoded><![CDATA[<p>thanks. very useful pointer. </p>
<p>there are nicer ways than execute, btw: you can use any of the other connection methods. This is how I get a list of matching tags for an ajax autocompleter:</p>
<p>Tag.connection.select_values(&#8220;SELECT name FROM #{Tag.table_name} where account_id = #{current_account.id} and name like &#8216;#{params[:stem]}%&#8217;&#8221;)</p>
<p>Nasty, but efficient. More possibilities at <a href="http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html" rel="nofollow">http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html</a></p>
<p>best,</p>
<p>will</p>
]]></content:encoded>
	</item>
</channel>
</rss>
