<?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 for rails:freeze:gems | freezzo.com</title>
	<atom:link href="http://www.freezzo.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freezzo.com</link>
	<description>A blog about web development, especially ruby on rails.</description>
	<pubDate>Wed, 07 Jan 2009 06:00:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>Comment on You have a nil object when you didn&#8217;t expect it! by Duke</title>
		<link>http://www.freezzo.com/2007/11/28/you-have-a-nil-object-when-you-didnt-expect-it/#comment-702</link>
		<dc:creator>Duke</dc:creator>
		<pubDate>Wed, 31 Dec 2008 00:51:13 +0000</pubDate>
		<guid isPermaLink="false">http://wp.freezzo.com/2008/02/15/you-have-a-nil-object-when-you-didnt-expect-it/#comment-702</guid>
		<description>Check out this little snippet:
def carefully(default = nil)
  begin
    yield
  rescue NoMethodError =&#62; e
    raise unless e.message["You have a nil object"]
    default
  end
end

carefully { @object.association.variable }

It only rescues when it's dereferencing a nil, rather than on any error.  In view code, and aesthetically, I do sort of prefer yours though.</description>
		<content:encoded><![CDATA[<p>Check out this little snippet:<br />
def carefully(default = nil)<br />
  begin<br />
    yield<br />
  rescue NoMethodError =&gt; e<br />
    raise unless e.message["You have a nil object"]<br />
    default<br />
  end<br />
end</p>
<p>carefully { @object.association.variable }</p>
<p>It only rescues when it&#8217;s dereferencing a nil, rather than on any error.  In view code, and aesthetically, I do sort of prefer yours though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Do you has a force field? by Ahad Bokhari</title>
		<link>http://www.freezzo.com/2008/09/23/do-you-has-a-force-field/#comment-699</link>
		<dc:creator>Ahad Bokhari</dc:creator>
		<pubDate>Mon, 29 Dec 2008 13:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/09/23/do-you-have-a-force-field/#comment-699</guid>
		<description>Haha, that is a sight to see.  With all this Rails injection i needed a quick laugh. LOLZ</description>
		<content:encoded><![CDATA[<p>Haha, that is a sight to see.  With all this Rails injection i needed a quick laugh. LOLZ</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on YouTube&#8217;s MP4 Video Formats by Randy</title>
		<link>http://www.freezzo.com/2008/05/03/youtube-mp4-video-format/#comment-668</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Mon, 22 Dec 2008 15:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/05/03/youtube-mp4-video-format/#comment-668</guid>
		<description>Was this on the jamzee site?</description>
		<content:encoded><![CDATA[<p>Was this on the jamzee site?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on YouTube&#8217;s MP4 Video Formats by grisser</title>
		<link>http://www.freezzo.com/2008/05/03/youtube-mp4-video-format/#comment-657</link>
		<dc:creator>grisser</dc:creator>
		<pubDate>Sat, 20 Dec 2008 18:50:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/05/03/youtube-mp4-video-format/#comment-657</guid>
		<description>playlist import as podcast to itunes doesn't seem to be working :\</description>
		<content:encoded><![CDATA[<p>playlist import as podcast to itunes doesn&#8217;t seem to be working :\</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Override default find conditions for model by PhilT</title>
		<link>http://www.freezzo.com/2008/05/14/override-default-find-conditions-for-model/#comment-650</link>
		<dc:creator>PhilT</dc:creator>
		<pubDate>Fri, 19 Dec 2008 09:49:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/05/14/override-default-find-conditions-for-model/#comment-650</guid>
		<description>Thanks. Just what I was looking for.

To answer AJ (a little late I know), you want to open up ActiveRecord::Base class (create a file in lib or an initializer then just do class ActiveRecord::Base) and alias the find method then use the code above and call the aliased method instead of super.

As for non-deleted in the example above you could just call ActiveRecord::Base.find directly but if you've aliased the method you'll want to call that instead.</description>
		<content:encoded><![CDATA[<p>Thanks. Just what I was looking for.</p>
<p>To answer AJ (a little late I know), you want to open up ActiveRecord::Base class (create a file in lib or an initializer then just do class ActiveRecord::Base) and alias the find method then use the code above and call the aliased method instead of super.</p>
<p>As for non-deleted in the example above you could just call ActiveRecord::Base.find directly but if you&#8217;ve aliased the method you&#8217;ll want to call that instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on href jumps to top of page by Randy</title>
		<link>http://www.freezzo.com/2008/09/09/href-jumps-to-top-of-page/#comment-499</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Fri, 31 Oct 2008 18:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/09/09/href-jumps-to-top-of-page/#comment-499</guid>
		<description>Thats cool too. Will that still work if the user has javascript turned off?</description>
		<content:encoded><![CDATA[<p>Thats cool too. Will that still work if the user has javascript turned off?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on href jumps to top of page by Ahmed El-Daly</title>
		<link>http://www.freezzo.com/2008/09/09/href-jumps-to-top-of-page/#comment-498</link>
		<dc:creator>Ahmed El-Daly</dc:creator>
		<pubDate>Fri, 31 Oct 2008 16:13:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/09/09/href-jumps-to-top-of-page/#comment-498</guid>
		<description>I use href="javascript:void(0)". I think it's neater.</description>
		<content:encoded><![CDATA[<p>I use href=&#8221;javascript:void(0)&#8221;. I think it&#8217;s neater.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord counting with associations by Dan Waldron</title>
		<link>http://www.freezzo.com/2008/10/22/activerecord-counting-with-associations/#comment-465</link>
		<dc:creator>Dan Waldron</dc:creator>
		<pubDate>Wed, 22 Oct 2008 18:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/10/22/activerecord-counting-with-associations/#comment-465</guid>
		<description>Hello.

I like your site and wanted to know if you would be interested in exchanging blogroll links.

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hello.</p>
<p>I like your site and wanted to know if you would be interested in exchanging blogroll links.</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Easy Hash to XML and back conversion in Ruby by Leon Bogaert</title>
		<link>http://www.freezzo.com/2008/10/08/easy-hash-to-xml-and-back-conversion-in-ruby/#comment-455</link>
		<dc:creator>Leon Bogaert</dc:creator>
		<pubDate>Tue, 21 Oct 2008 12:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.freezzo.com/2008/10/08/easy-hash-to-xml-and-back-conversion-in-ruby/#comment-455</guid>
		<description>If you 're interested in this, also look at: http://rubyforge.org/projects/hashtoxml/</description>
		<content:encoded><![CDATA[<p>If you &#8216;re interested in this, also look at: <a href="http://rubyforge.org/projects/hashtoxml/" rel="nofollow">http://rubyforge.org/projects/hashtoxml/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Rails error: syntax error, unexpected tINTEGER Object::1 by Satish</title>
		<link>http://www.freezzo.com/2007/12/27/rails-error-syntax-error-unexpected-tinteger-object/#comment-449</link>
		<dc:creator>Satish</dc:creator>
		<pubDate>Mon, 20 Oct 2008 10:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://wp.freezzo.com/2008/02/15/rails-error-syntax-error-unexpected-tinteger-object/#comment-449</guid>
		<description>Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
