<?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: Eager Find by SQL Pagination in Rails</title>
	<atom:link href="http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/</link>
	<description>A goal is a dream with a deadline.</description>
	<pubDate>Fri, 29 Aug 2008 04:44:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102485</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Wed, 16 Apr 2008 06:55:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102485</guid>
		<description>Terrell, thanks for the sharing the fix, much appreciated!</description>
		<content:encoded><![CDATA[<p>Terrell, thanks for the sharing the fix, much appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terrell</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102400</link>
		<dc:creator>Terrell</dc:creator>
		<pubDate>Sat, 12 Apr 2008 14:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102400</guid>
		<description>Ilya, I was seeing the LIMIT -X,X behavior as well (same as Yves back in Jan07).  The offset was being set to a negative when params[:current] is nil on the initial default passthrough.  I added a simple check to get the offset back to 0 in that case - there's probably a more elegant solution...

&lt;code&gt;
 # calculate the right offset values for current page and page_size
 offset = (options[:current].to_i - 1) * options[:page_size]
 offset = 0 if offset &#60; 0 # was seeing "LIMIT -X,X" by default
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ilya, I was seeing the LIMIT -X,X behavior as well (same as Yves back in Jan07).  The offset was being set to a negative when params[:current] is nil on the initial default passthrough.  I added a simple check to get the offset back to 0 in that case - there&#8217;s probably a more elegant solution&#8230;</p>
<p><code><br />
 # calculate the right offset values for current page and page_size<br />
 offset = (options[:current].to_i - 1) * options[:page_size]<br />
 offset = 0 if offset &lt; 0 # was seeing &#8220;LIMIT -X,X&#8221; by default<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102322</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Mon, 07 Apr 2008 11:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102322</guid>
		<description>Neal, glad you got it working!</description>
		<content:encoded><![CDATA[<p>Neal, glad you got it working!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neal Harmon</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102313</link>
		<dc:creator>Neal Harmon</dc:creator>
		<pubDate>Sat, 05 Apr 2008 03:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102313</guid>
		<description>Nevermind. I was passing in get variables that were hashes and paginating_find doesn't support those. I've changed my form so that it doesn't submit those and it's working great.

Thanks for the code Ilya!</description>
		<content:encoded><![CDATA[<p>Nevermind. I was passing in get variables that were hashes and paginating_find doesn&#8217;t support those. I&#8217;ve changed my form so that it doesn&#8217;t submit those and it&#8217;s working great.</p>
<p>Thanks for the code Ilya!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neal Harmon</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102312</link>
		<dc:creator>Neal Harmon</dc:creator>
		<pubDate>Sat, 05 Apr 2008 00:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-102312</guid>
		<description>What if I want to add params to this solution? 

www.url.com/?page=2&#38;myvariable=123

I can't figure out how to get that in there. What am I missing?</description>
		<content:encoded><![CDATA[<p>What if I want to add params to this solution? </p>
<p><a href="http://www.url.com/?page=2&amp;myvariable=123" rel="nofollow">http://www.url.com/?page=2&amp;myvariable=123</a></p>
<p>I can&#8217;t figure out how to get that in there. What am I missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101256</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Thu, 31 Jan 2008 06:30:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101256</guid>
		<description>Doh, fixed the swapped variables names in the post. Thanks Alan.</description>
		<content:encoded><![CDATA[<p>Doh, fixed the swapped variables names in the post. Thanks Alan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101235</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Tue, 29 Jan 2008 23:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101235</guid>
		<description>Am I the only one who noticed this?
&lt;code&gt;LIMIT #{offset} OFFSET #{limit}"&lt;/code&gt;
The variables are mixed up. Just spent 20 minutes trying to figure out why my PEs were empty. Grrr ...</description>
		<content:encoded><![CDATA[<p>Am I the only one who noticed this?<br />
<code>LIMIT #{offset} OFFSET #{limit}"</code><br />
The variables are mixed up. Just spent 20 minutes trying to figure out why my PEs were empty. Grrr &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101111</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Mon, 21 Jan 2008 05:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101111</guid>
		<description>Thanks for your valuable suggestion !</description>
		<content:encoded><![CDATA[<p>Thanks for your valuable suggestion !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101105</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Mon, 21 Jan 2008 01:49:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101105</guid>
		<description>Amit, by paginate over two unrelated tables, do you mean merge the results? If so, you could run a UNION query and then do a pagination on that. It gets a little trickier, but theoretically, it is possible.</description>
		<content:encoded><![CDATA[<p>Amit, by paginate over two unrelated tables, do you mean merge the results? If so, you could run a UNION query and then do a pagination on that. It gets a little trickier, but theoretically, it is possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://www.igvita.com/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101072</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Thu, 17 Jan 2008 16:52:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2006/09/22/eager-find-by-sql-pagination-in-rails/#comment-101072</guid>
		<description>Awesome article.. my problem is a bit different…

I have two different tables. There is no relationship between these tables. But these tables are tagged ….

Is there any way to paginate over 2 unrelated tables ..

It would be great if someone can throw some suggestions …

Thanks in advance !</description>
		<content:encoded><![CDATA[<p>Awesome article.. my problem is a bit different…</p>
<p>I have two different tables. There is no relationship between these tables. But these tables are tagged ….</p>
<p>Is there any way to paginate over 2 unrelated tables ..</p>
<p>It would be great if someone can throw some suggestions …</p>
<p>Thanks in advance !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
