<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for activerecord</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Thu, 28 Aug 2008 15:55:55 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Overriding ActiveRecord's find method</title>
	<link>http://www.bytemycode.com/snippets/snippet/460/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/460/comments/</comments>
	<pubDate>Wed, 11 Oct 2006 15:08:47 +0000</pubDate>
	<dc:creator>jeremec</dc:creator>
	<category>activerecord, find, override, rails, Ruby</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/460/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Oct. 11th, 2006  3:08 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/460/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/jeremec/" title="Helper">jeremec</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/activerecord">activerecord</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/find">find</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/override">override</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/rails">rails</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Ruby">Ruby</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/460/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 1
			<p>From time to time you may have reasons to override the default find method that ActiveRecord provides.  In this example, we'll store a side-copy of the record attributes so that we have some basis for discovering changes to the data.<br /><br /><i>note: this will not override dynamic finders such as find_by_id</i></p>
		]]>
	</description>
</item>
	</channel>
</rss>