<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,45 +9,62 @@ begin
   describe &quot;DataMapper::Resource&quot; do
     describe &quot;inheritance&quot; do
       before(:all) do
-        class Father
+        class Male
           include DataMapper::Resource
           property :id, Fixnum, :serial =&gt; true
           property :name, String
-          
+          property :iq, Fixnum, :default =&gt; 100
           property :type, Class, :default =&gt; lambda { |r,p| p.model }
         end
         
-        class Son &lt; Father
-          property :favourite, Boolean, :default =&gt; false
+        class Bully &lt; Male
+          # property :brutal, Boolean, :default =&gt; true 
+          # Automigrate should add fields for all subclasses of an STI-model, but currently it does not.
+        end
+        
+        class Geek &lt; Male
+          property :awkward, Boolean, :default =&gt; true
         end
         
-        Son.auto_migrate!(:sqlite3)
+        Geek.auto_migrate!(:sqlite3)
         
         repository(:sqlite3) do
-          Father.create!(:name =&gt; 'Bob')
-          Son.create!(:name =&gt; 'Fred', :favourite =&gt; true)
-          Son.create!(:name =&gt; 'Barney')
-          Father.create!(:name =&gt; 'Johnson')
+          Male.create!(:name =&gt; 'John Dorian')
+          Bully.create!(:name =&gt; 'Bob')
+          Geek.create!(:name =&gt; 'Steve', :awkward =&gt; false, :iq =&gt; 132)
+          Geek.create!(:name =&gt; 'Bill', :iq =&gt; 150)
+          Bully.create!(:name =&gt; 'Johnson')
         end
       end
       
       it &quot;should select appropriate types&quot; do
         repository(:sqlite3) do
-          fathers = Father.all
-          fathers.should have(4).entries
+          males = Male.all
+          males.should have(5).entries
           
-          fathers.each do |father|
-            father.class.name.should == father.type.name
+          males.each do |male|
+            male.class.name.should == male.type.name
           end
           
-          Father.first(:name =&gt; 'Bob').should be_a_kind_of(Father)
-          Son.first(:name =&gt; 'Fred').should be_a_kind_of(Son)
-          Son.first(:name =&gt; 'Barney').should be_a_kind_of(Son)
-          Father.first(:name =&gt; 'Johnson').should be_a_kind_of(Father)
+          Male.first(:name =&gt; 'Steve').should be_a_kind_of(Geek)
+          Bully.first(:name =&gt; 'Bob').should be_a_kind_of(Bully)
+          Geek.first(:name =&gt; 'Steve').should be_a_kind_of(Geek)
+          Geek.first(:name =&gt; 'Bill').should be_a_kind_of(Geek)
+          Bully.first(:name =&gt; 'Johnson').should be_a_kind_of(Bully)
+          Male.first(:name =&gt; 'John Dorian').should be_a_kind_of(Male) 
+        end
+      end
+      
+      it &quot;should not select parent type&quot; do
+        pending(&quot;Bug...&quot;)
+        repository(:sqlite3) do
+          Male.first(:name =&gt; 'John Dorian').should be_a_kind_of(Male)
+          Geek.first(:name =&gt; 'John Dorian').should be_nil
+          Geek.first.iq.should &gt; Bully.first.iq # now its matching Male#1 against Male#1        
         end
       end
     end
   end
 rescue LoadError
   warn &quot;integration/repository_spec not run! Could not load do_sqlite3.&quot;
-end
+end
\ No newline at end of file</diff>
      <filename>spec/integration/resource_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f94ab0cf1ec0674609fd29d82dd67fa9dd67a290</id>
    </parent>
  </parents>
  <author>
    <name>Sindre Aarsaether</name>
    <email>sindre@identu.no</email>
  </author>
  <url>http://github.com/sam/dm-core/commit/1a8d999590706c5a9c6c9543cb2e334466e971f6</url>
  <id>1a8d999590706c5a9c6c9543cb2e334466e971f6</id>
  <committed-date>2008-05-01T14:50:44-07:00</committed-date>
  <authored-date>2008-05-01T14:50:44-07:00</authored-date>
  <message>changed the STI-spec to be a little more clear</message>
  <tree>6c79bf928d848f12c68dbd664681189472463801</tree>
  <committer>
    <name>Sindre Aarsaether</name>
    <email>sindre@identu.no</email>
  </committer>
</commit>
