<?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: Modules, self and classes</title>
	<atom:link href="http://www.innovationfactory.eu/2007/12/17/modules-self-and-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innovationfactory.eu/2007/12/17/modules-self-and-classes/</link>
	<description></description>
	<lastBuildDate>Fri, 04 Nov 2011 05:51:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Harm Aarts</title>
		<link>http://www.innovationfactory.eu/2007/12/17/modules-self-and-classes/#comment-62</link>
		<dc:creator>Harm Aarts</dc:creator>
		<pubDate>Tue, 15 Jul 2008 08:14:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovationfactory.nl/blog/2007/12/17/modules-self-and-classes/#comment-62</guid>
		<description>Ah! Most excellent. I will incorporate the upgrade into my code. Thanks!</description>
		<content:encoded><![CDATA[<p>Ah! Most excellent. I will incorporate the upgrade into my code. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yardboy</title>
		<link>http://www.innovationfactory.eu/2007/12/17/modules-self-and-classes/#comment-61</link>
		<dc:creator>Yardboy</dc:creator>
		<pubDate>Fri, 11 Jul 2008 18:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovationfactory.nl/blog/2007/12/17/modules-self-and-classes/#comment-61</guid>
		<description>This was a very helpful post - thanks! I modified your copy method slightly to allow passing in a hash of attribute values that will override the copied values. This also allows on-the-spot overrides of the non_duplicatable_columns.

    def copy(overrides = {})
      copy_columns = self.class.column_names - self.class.non_duplicatable_columns
      a = Hash.new
      copy_columns.each {&#124;cc&#124; a[cc.to_sym] = self.send(cc) }
      clone = self.class.create(a.merge(overrides))
    end</description>
		<content:encoded><![CDATA[<p>This was a very helpful post &#8211; thanks! I modified your copy method slightly to allow passing in a hash of attribute values that will override the copied values. This also allows on-the-spot overrides of the non_duplicatable_columns.</p>
<p>    def copy(overrides = {})<br />
      copy_columns = self.class.column_names &#8211; self.class.non_duplicatable_columns<br />
      a = Hash.new<br />
      copy_columns.each {|cc| a[cc.to_sym] = self.send(cc) }<br />
      clone = self.class.create(a.merge(overrides))<br />
    end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

