<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+v0.1.3. fixed bug in restoring saved object
+
 v0.1.2. ensure id_names are unique
 
 v0.1.1. updated to use Soup 0.2.1</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'morph'
 require 'soup'
 
 module Pottery
-  VERSION = &quot;0.1.2&quot;
+  VERSION = &quot;0.1.3&quot;
 
   def self.included(base)
     Soup.prepare
@@ -18,16 +18,16 @@ module Pottery
 
   module ClassMethods
     def restore name
-      snip = Soup[name]
-      if snip &amp;&amp; snip != []
-        if snip.is_a? Array
-          last = snip.pop
+      existing = Soup[name]
+      if existing &amp;&amp; !(existing.is_a?(Array) &amp;&amp; existing.empty?)
+        if existing.is_a? Array
+          last = existing.pop
           puts 'deleting duplicates for id: ' + name
-          snip.each {|x| x.destroy}
-          snip = last
+          existing.each {|x| x.destroy}
+          existing = last
         end
         instance = self.new
-        attributes = snip.attributes
+        attributes = existing.attributes
         unless attributes.empty?
           id_name = attributes.delete('name')
           name = attributes.delete('name_name')
@@ -47,7 +47,7 @@ module Pottery
     def save
       if respond_to?('id_name') &amp;&amp; !id_name.nil? &amp;&amp; !(id_name.to_s.strip.size == 0)
         existing = Soup[id_name]
-        if existing &amp;&amp; existing != []
+        if existing &amp;&amp; !(existing.is_a?(Array) &amp;&amp; existing.empty?)
           if existing.is_a? Array
             last = existing.pop
             puts 'deleting duplicates for id: ' + id_name</diff>
      <filename>lib/pottery.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e1346faf85cfbe5f8a2c78f4e4ae3997f8792ff0</id>
    </parent>
  </parents>
  <author>
    <name>robmckinnon</name>
    <email>rob@theyworkforyou.co.nz</email>
  </author>
  <url>http://github.com/robmckinnon/pottery/commit/0f7c51c052d7e29a05cb60604669c838c2b1c793</url>
  <id>0f7c51c052d7e29a05cb60604669c838c2b1c793</id>
  <committed-date>2009-01-01T10:06:09-08:00</committed-date>
  <authored-date>2009-01-01T10:06:09-08:00</authored-date>
  <message>fixed bug in loading saved object</message>
  <tree>9aa9d595448d23982edba17396cf04432b67aede</tree>
  <committer>
    <name>robmckinnon</name>
    <email>rob@theyworkforyou.co.nz</email>
  </committer>
</commit>
