<?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: ActiveRecord Enumerable</title>
	<atom:link href="http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/</link>
	<description>Sentenced to making sense</description>
	<lastBuildDate>Thu, 08 Apr 2010 22:54:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: michael barton &#187; Blog Archive &#187; ActiveRecord and extremely large tables or queries</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-73278</link>
		<dc:creator>michael barton &#187; Blog Archive &#187; ActiveRecord and extremely large tables or queries</dc:creator>
		<pubDate>Sun, 12 Oct 2008 16:43:29 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-73278</guid>
		<description>[...] with the size of the dataset. A (possibly MySQL specific) solution described by both Jamis Buck and Michael Schuerig relies on splitting the dataset into smaller chunks based on the primary key. Since the primary key [...]</description>
		<content:encoded><![CDATA[<p>[...] with the size of the dataset. A (possibly MySQL specific) solution described by both Jamis Buck and Michael Schuerig relies on splitting the dataset into smaller chunks based on the primary key. Since the primary key [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michael</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-3541</link>
		<dc:creator>michael</dc:creator>
		<pubDate>Thu, 31 May 2007 20:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-3541</guid>
		<description>Arthur Lyman asked:

&lt;blockquote&gt;
I am interested in trying out ar-enumerable in a test Rails app I am working on.

When I run the command  below, nothing happens.  Have I done something not quite right?

RUBY script/plugin install Svn://rubyforge.org/var/svn/ar-enumerable/ar_enumerable/trunk

Is the plug-in available at this time?
&lt;/blockquote&gt;

Yes, the plugin is available, I just checked it. You have to make sure that you use the correct URL, in particular, it has to start with &quot;svn:&quot; not &quot;Svn:&quot;, i.e.

&lt;code&gt;svn://rubyforge.org/var/svn/ar-enumerable/ar_enumerable/trunk&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Arthur Lyman asked:</p>
<blockquote><p>
I am interested in trying out ar-enumerable in a test Rails app I am working on.</p>
<p>When I run the command  below, nothing happens.  Have I done something not quite right?</p>
<p>RUBY script/plugin install Svn://rubyforge.org/var/svn/ar-enumerable/ar_enumerable/trunk</p>
<p>Is the plug-in available at this time?
</p></blockquote>
<p>Yes, the plugin is available, I just checked it. You have to make sure that you use the correct URL, in particular, it has to start with &#8220;svn:&#8221; not &#8220;Svn:&#8221;, i.e.</p>
<p><code><a href="svn://rubyforge.org/var/svn/ar-enumerable/ar_enumerable/trunk" rel="nofollow">svn://rubyforge.org/var/svn/ar-enumerable/ar_enumerable/trunk</a></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michael</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-288</link>
		<dc:creator>michael</dc:creator>
		<pubDate>Wed, 07 Mar 2007 18:52:29 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-288</guid>
		<description>Drew: A gem on its own wouldn&#039;t do much good. The enumeration functionality must be inserted into ActiveRecord and that&#039;s something a gem can&#039;t do by itself.

If you want to use the AR Enumeration in your app and the Rails plugin loading mechanism is not available, you need to do two things: First, make sure that the directory containing &lt;code&gt;ar_enumerable.rb&lt;/code&gt; is in the load path (the Ruby global variable &lt;code&gt;$:&lt;/code&gt;). Then execute the code in &lt;code&gt;init.rb&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>Drew: A gem on its own wouldn&#8217;t do much good. The enumeration functionality must be inserted into ActiveRecord and that&#8217;s something a gem can&#8217;t do by itself.</p>
<p>If you want to use the AR Enumeration in your app and the Rails plugin loading mechanism is not available, you need to do two things: First, make sure that the directory containing <code>ar_enumerable.rb</code> is in the load path (the Ruby global variable <code>$:</code>). Then execute the code in <code>init.rb</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-287</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Wed, 07 Mar 2007 17:08:21 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-287</guid>
		<description>Michael -

I&#039;ve been using this plugin on a test basis and I like what I see. Another simple question: can we get a gem (for non-rails work) of this app? I think you&#039;d be surprised the amount of people that are looking for something lik this to use with some type of statistical analysis of data outside rails using activerecord.

Thanks,
Drew</description>
		<content:encoded><![CDATA[<p>Michael -</p>
<p>I&#8217;ve been using this plugin on a test basis and I like what I see. Another simple question: can we get a gem (for non-rails work) of this app? I think you&#8217;d be surprised the amount of people that are looking for something lik this to use with some type of statistical analysis of data outside rails using activerecord.</p>
<p>Thanks,<br />
Drew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michael</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-114</link>
		<dc:creator>michael</dc:creator>
		<pubDate>Tue, 13 Feb 2007 22:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-114</guid>
		<description>Drew: I&#039;ve never used ActiveRecord on its own, but I&#039;m pretty sure you can use the plugin with it, without the rest of the Rails frameworks. In your setting, plugins are not loaded and initialized automatically, therefore you have to make sure yourself, that the plugin&#039;s lib directory is added to the load path (&lt;code&gt;$:.unshift ...&lt;/code&gt;) and that &lt;code&gt;init.rb&lt;/code&gt; is called.

Regarding coordinated iteration over two tables, I haven&#039;t thought of this before, and I don&#039;t have a solution handy. Have a look at the standard Ruby Enumerator and Generator libraries, they may help you get what you need.

Be sure to wrap a transaction block around the combined iteration! ActiveRecord Enumerable internally uses a transaction block, but you have to ensure that all iteration/cursor are in the same single transaction.

I gather that Enumerator/Generator use some &lt;code&gt;callcc&lt;/code&gt; magic to jump out of and back into a scope. I&#039;m not completely sure that this won&#039;t mess up things in some way.</description>
		<content:encoded><![CDATA[<p>Drew: I&#8217;ve never used ActiveRecord on its own, but I&#8217;m pretty sure you can use the plugin with it, without the rest of the Rails frameworks. In your setting, plugins are not loaded and initialized automatically, therefore you have to make sure yourself, that the plugin&#8217;s lib directory is added to the load path (<code>$:.unshift ...</code>) and that <code>init.rb</code> is called.</p>
<p>Regarding coordinated iteration over two tables, I haven&#8217;t thought of this before, and I don&#8217;t have a solution handy. Have a look at the standard Ruby Enumerator and Generator libraries, they may help you get what you need.</p>
<p>Be sure to wrap a transaction block around the combined iteration! ActiveRecord Enumerable internally uses a transaction block, but you have to ensure that all iteration/cursor are in the same single transaction.</p>
<p>I gather that Enumerator/Generator use some <code>callcc</code> magic to jump out of and back into a scope. I&#8217;m not completely sure that this won&#8217;t mess up things in some way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-111</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Tue, 13 Feb 2007 19:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-111</guid>
		<description>Michael -

This seems like it would be very helpful for a data validation suite I&#039;m attempting to write using ActiveRecord. A couple of questions for you:

1. Can I install this plugin outside of the rails framework? I&#039;m currently only using the ActiveRecord gem in my work.

2. Is there support for manually controlling iteration across the objects? For example, during data validation I&#039;d like to manually compare records from two tables (both of which I&#039;d like to access using your plugin, as they are quite large) and then in some case move to the next object in either 1 or both of the data sets. I need to manually control when the next object is yielded and need to iterate across two tables at the same time. If this is not supported, is there a simple way for me to create some type of where_two method which would give me this functionality?

Seems like a great start on a problem with ActiveRecord that has bothered me for a while :)

-Drew</description>
		<content:encoded><![CDATA[<p>Michael -</p>
<p>This seems like it would be very helpful for a data validation suite I&#8217;m attempting to write using ActiveRecord. A couple of questions for you:</p>
<p>1. Can I install this plugin outside of the rails framework? I&#8217;m currently only using the ActiveRecord gem in my work.</p>
<p>2. Is there support for manually controlling iteration across the objects? For example, during data validation I&#8217;d like to manually compare records from two tables (both of which I&#8217;d like to access using your plugin, as they are quite large) and then in some case move to the next object in either 1 or both of the data sets. I need to manually control when the next object is yielded and need to iterate across two tables at the same time. If this is not supported, is there a simple way for me to create some type of where_two method which would give me this functionality?</p>
<p>Seems like a great start on a problem with ActiveRecord that has bothered me for a while <img src='http://www.schuerig.de/michael/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>-Drew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marcello</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-105</link>
		<dc:creator>marcello</dc:creator>
		<pubDate>Mon, 12 Feb 2007 23:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-105</guid>
		<description>thanks michael!</description>
		<content:encoded><![CDATA[<p>thanks michael!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Schierbeck</title>
		<link>http://www.schuerig.de/michael/blog/index.php/2007/02/03/ar-enumerable/comment-page-1/#comment-103</link>
		<dc:creator>Daniel Schierbeck</dc:creator>
		<pubDate>Mon, 12 Feb 2007 22:18:40 +0000</pubDate>
		<guid isPermaLink="false">http://schuerig.de/michael/blog/?p=12#comment-103</guid>
		<description>Just a reminder, you don&#039;t need to write the equal sign in the following:

  Person.where([&#039;lastname = ?&#039;, &#039;Smith&#039;]).inject(0) do &#124;income, person&#124;
    income += person.income
  end

Since the *value* of the block is what&#039;s being stored in &#039;income&#039;. So the example should look like this:

  Person.where([&#039;lastname = ?&#039;, &#039;Smith&#039;]).inject(0) do &#124;income, person&#124;
    income + person.income
  end</description>
		<content:encoded><![CDATA[<p>Just a reminder, you don&#8217;t need to write the equal sign in the following:</p>
<p>  Person.where(['lastname = ?', 'Smith']).inject(0) do |income, person|<br />
    income += person.income<br />
  end</p>
<p>Since the *value* of the block is what&#8217;s being stored in &#8216;income&#8217;. So the example should look like this:</p>
<p>  Person.where(['lastname = ?', 'Smith']).inject(0) do |income, person|<br />
    income + person.income<br />
  end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

