<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mundo Ruby &#187; tricks</title>
	<atom:link href="http://www.mundoruby.com.ar/tag/tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mundoruby.com.ar</link>
	<description>Ruby Artists, Hackers y otras yerbas ...</description>
	<lastBuildDate>Wed, 12 Aug 2009 23:02:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creando consultas ActiveRecord a partir de SQL</title>
		<link>http://www.mundoruby.com.ar/2009/03/22/creando-consultas-activerecord-a-partir-de-sql/</link>
		<comments>http://www.mundoruby.com.ar/2009/03/22/creando-consultas-activerecord-a-partir-de-sql/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 13:47:21 +0000</pubDate>
		<dc:creator>FreedomCoder</dc:creator>
				<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.mundoruby.com.ar/?p=52</guid>
		<description><![CDATA[
Buscando la razón por la cual me falla un find_each dentro de un rake, me encontré con este sitio que sin dudas no deja de ser interesante. Suele pasar que tenemos en claro como construir una sentencia SQL pero no sabemos como hacerlo en ActiveRecord. Este pequeño script lo resuelve. Lo estuve probando y hay [...]]]></description>
			<content:encoded><![CDATA[<p>
Buscando la razón por la cual me falla un find_each dentro de un rake, me encontré con este <a href="http://rorbuilder.info/r/sql2arf/index.html">sitio</a> que sin dudas no deja de ser interesante. Suele pasar que tenemos en claro como construir una sentencia SQL pero no sabemos como hacerlo en ActiveRecord. Este pequeño script lo resuelve. Lo estuve probando y hay casos en los que no devuelve nada, como ser pasando rangos con BETWEEN, por ejemplo.</p>
<p><code><br />
 select * from members where first_name = 'Harold' and age = '34'<br />
 => Members.find(:all, :conditions => {:age => "34", :first_name => "Harold"}</p>
<p> select * from members<br />
 => Members.find(:all)</p>
<p> select * from members where first_name = 'Harold'<br />
 => Members.find(:all, :conditions => {:first_name => "Harold"}</p>
<p> select * from members where first_name like '%Harold%'<br />
 => Members.find(:all, :conditions => ["first_name like ?", '%Harold%'])<br />
</code></p>
<p><a href="http://www.rodolinux.com.ar/node/122">leer más</a></p>
<p>(Via <a href="http://www.rodolinux.com.ar">Rodolinux &#8211; Rodolinux&#8217;s Playground</a>.)Original Link: <a href="http://www.rodolinux.com.ar/node/122#comments">Creando consultas ActiveRecord a partir de SQL</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7949681675937032";
google_ad_slot = "0874687580";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mundoruby.com.ar/2009/03/22/creando-consultas-activerecord-a-partir-de-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

