<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:ent="http://www.purl.org/NET/ENT/1.0/" version="2.0">
  <channel>
    <title>Curiouser and Curiouser! on oddities</title>
    <link>http://matt.blogs.it/</link>
    <description>RSS feed for topic oddities</description>
    <copyright>Copyright 2007 Matt Mower. Some rights reserved.</copyright>
    <generator>Squib/0.5.0.382</generator>
    <managingEditor>self@mattmower.com</managingEditor>
    <webMaster>self@mattmower.com</webMaster>
    <language>en-gb</language>
    <item>
      <title>Ghost in the machine</title>
      <link>http://matt.blogs.it/entries/00002542.html</link>
      <pubDate>Fri, 20 Apr 2007 10:24:40 +0100</pubDate>
      <description>&lt;p&gt;Yesterday in trying to debug a problem in &lt;a href="http://www.cominded.com/"&gt;our&lt;/a&gt; application I came across a very odd situation indeed. An object was failing to save somewhere in a chain of associations. After some rather painful debugging (made bearable only by Kent Sibilev's excellent &lt;a href="http://rubyforge.org/projects/ruby-debug/"&gt;ruby-debug package&lt;/a&gt;) I found the culprit.&lt;/p&gt;

&lt;p&gt;Somehow an object &lt;code&gt;o&lt;/code&gt; had sprung into being such that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;o.nil?
=&amp;gt; false

o.class
=&amp;gt; nil

o.object_id
=&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;How can such a &lt;em&gt;ghostly apparition&lt;/em&gt; come to be? It is possible to create on deliberately... redefining the &lt;code&gt;class&lt;/code&gt; and &lt;code&gt;object_id&lt;/code&gt; methods to return &lt;code&gt;nil&lt;/code&gt; for example. But it's hard to see how such an object can occur naturally. Has anyone seen such a thing?&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002542.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
  </channel>
</rss>
