<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
+\.*
 test_log
 pkg
 pkg/*
@@ -16,7 +17,6 @@ coverage
 lib/dm-more.rb
 *.db
 nbproject
-.DS_Store
 rspec_report.html
 *.swp
 _Yardoc</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,13 @@
 require 'pathname'
 require 'rubygems'
 
-gem 'dm-core', '0.10.0'
+dir = Pathname(__FILE__).dirname.expand_path / 'dm-constraints'
 
-dir = Pathname(__FILE__).dirname.expand_path
+require dir / 'delete_constraint'
+require dir / 'migrations'
+require dir / 'version'
 
-require dir / 'dm-constraints' / 'delete_constraint'
-require dir / 'dm-constraints' / 'migrations'
+gem 'dm-core', DataMapper::Constraints::VERSION
 
 module DataMapper
   module Associations
@@ -14,7 +15,6 @@ module DataMapper
       include Extlib::Hook
       include Constraints::DeleteConstraint
 
-      attr_reader :constraint
       OPTIONS &lt;&lt; :constraint
 
       # initialize is a private method in Relationship
@@ -24,6 +24,18 @@ module DataMapper
         before :initialize, :add_constraint_option
       end
     end
+
+    module OneToMany
+      class Relationship
+        attr_reader :constraint
+      end
+    end
+
+    module ManyToOne
+      class Relationship
+        attr_reader :constraint
+      end
+    end
   end
 
   module Constraints</diff>
      <filename>dm-constraints/lib/dm-constraints.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,19 +25,20 @@ module DataMapper
         def check_delete_constraint_type(cardinality, name, options = {})
           return unless options.key?(:constraint)
 
-          constraint_type = options[:constraint]
+          constraint = options[:constraint]
 
-          unless CONSTRAINT_OPTIONS.include?(constraint_type)
+          unless CONSTRAINT_OPTIONS.include?(constraint)
             raise ArgumentError, &quot;:constraint option must be one of #{CONSTRAINT_OPTIONS.to_a.join(', ')}&quot;
           end
 
-          if constraint_type == :set_nil &amp;&amp; options.key?(:through)
+          # XXX: is any constraint valid with a :through relationship?
+          if constraint == :set_nil &amp;&amp; options.key?(:through)
             raise ArgumentError, 'Constraint type :set_nil is not valid for relationships using :through'
           end
 
           min, max = extract_min_max(cardinality)
 
-          if max == 1 &amp;&amp; constraint_type == :destroy!
+          if max == 1 &amp;&amp; constraint == :destroy!
             raise ArgumentError, 'Constraint type :destroy! is not valid for one-to-one relationships'
           end
         end
@@ -71,14 +72,11 @@ module DataMapper
       #
       # @param params [*ARGS] Arguments passed to Relationship#initialize or RelationshipChain#initialize
       #
-      # @notes This takes *params because it runs before the initializer for Relationships and Many to Many Relationships
-      #   which have different method signatures
-      #
       # @return [nil]
       #
       # @api semi-public
       def add_constraint_option(name, child_model, parent_model, options = {})
-        @constraint = options.delete(:constraint) || :protect
+        @constraint = options.fetch(:constraint, :protect) || :skip
       end
 
       ##
@@ -96,18 +94,15 @@ module DataMapper
       def check_delete_constraints
         relationships.each_value do |relationship|
           next if relationship.kind_of?(Associations::ManyToOne::Relationship)
-          next unless constraint_type = relationship.constraint
           next unless association = relationship.get(self)
 
-          case constraint_type
+          case constraint = relationship.constraint
             when :protect
               throw(:halt, false) if Array(association).any?
             when :destroy, :destroy!
-              association.send(constraint_type)
+              association.send(constraint)
             when :set_nil
-              # TODO: expose a method called orphan in the relationships
-              # that orphans a resource from an association
-              Array(association).each { |r| relationship.target_key.set(r, []); r.save }
+              Array(association).each { |r| relationship.inverse.set(r, nil); r.save }
             when :skip
               # do nothing
           end</diff>
      <filename>dm-constraints/lib/dm-constraints/delete_constraint.rb</filename>
    </modified>
    <modified>
      <diff>@@ -88,17 +88,14 @@ module DataMapper
           constraint_name = constraint_name(source_table, relationship.name)
           return false if constraint_exists?(source_table, constraint_name)
 
-          constraint_type = case relationship.inverse &amp;&amp; relationship.inverse.constraint || :protect
+          constraint_type = case relationship.inverse.constraint
             when :protect            then 'NO ACTION'
             when :destroy, :destroy! then 'CASCADE'
             when :set_nil            then 'SET NULL'
-            when :skip               then nil
           end
 
           return false if constraint_type.nil?
 
-          repository = DataMapper.repository(name)
-
           storage_name           = relationship.source_model.storage_name(name)
           reference_storage_name = relationship.target_model.storage_name(name)
 </diff>
      <filename>dm-constraints/lib/dm-constraints/migrations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,13 @@
 require 'pathname'
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
 
-ADAPTERS.each do |name,connection_uri|
-  describe 'DataMapper::Constraints' do
+ADAPTERS.each do |name, connection_uri|
+  describe 'DataMapper::Constraints', &quot;(with #{name})&quot; do
     before :all do
       @adapter    = DataMapper.setup(:default, connection_uri)
       @repository = DataMapper.repository(@adapter.name)
     end
 
-    after do
-      DataMapper.send(:auto_migrate_down!, @repository.name)
-    end
-
     before do
       class ::Stable
         include DataMapper::Resource
@@ -82,70 +78,74 @@ ADAPTERS.each do |name,connection_uri|
       DataMapper.auto_migrate!
     end
 
-    it &quot;is included when DataMapper::Constraints is loaded&quot; do
+    after do
+      DataMapper.send(:auto_migrate_down!, @repository.name)
+    end
+
+    it 'is included when DataMapper::Constraints is loaded' do
       Cow.new.should be_kind_of(DataMapper::Constraints)
     end
 
-    it &quot;should be able to create related objects with a foreign key constraint&quot; do
-      @s  = Stable.create(:location =&gt; &quot;Hometown&quot;)
-      @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :stable =&gt; @s)
+    it 'should be able to create related objects with a foreign key constraint' do
+      @s  = Stable.create(:location =&gt; 'Hometown')
+      @c1 = Cow.create(:name =&gt; 'Bea', :stable =&gt; @s)
     end
 
-    it &quot;should be able to create related objects with a composite foreign key constraint&quot; do
-      @f  = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-      @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
+    it 'should be able to create related objects with a composite foreign key constraint' do
+      @f  = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+      @c1 = Cow.create(:name =&gt; 'Bea', :farmer =&gt; @f)
     end
 
-    it &quot;should not be able to create related objects with a failing foreign key constraint&quot; do
+    it 'should not be able to create related objects with a failing foreign key constraint' do
       s = Stable.create
-      lambda { @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :stable_id =&gt; s.id + 1) }.should raise_error
+      lambda { @c1 = Cow.create(:name =&gt; 'Bea', :stable_id =&gt; s.id + 1) }.should raise_error
     end
 
-    describe &quot;belongs_to without matching has association&quot; do
+    describe 'belongs_to without matching has association' do
       before do
-        @f1 = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-        @f2 = Farmer.create(:first_name =&gt; &quot;Some&quot;, :last_name =&gt; &quot;Body&quot;)
-        @p = Pig.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f2)
+        @f1 = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+        @f2 = Farmer.create(:first_name =&gt; 'Some', :last_name =&gt; 'Body')
+        @p  = Pig.create(:name =&gt; 'Bea', :farmer =&gt; @f2)
       end
 
-      it &quot;should destroy the parent if there are no children in the association&quot; do
-        @f1.destroy.should == true
+      it 'should destroy the parent if there are no children in the association' do
+        @f1.destroy.should be_true
       end
 
-      it &quot;the child should be destroyable&quot; do
-        @p.destroy.should == true
+      it 'the child should be destroyable' do
+        @p.destroy.should be_true
       end
     end
 
-    describe &quot;constraint options&quot; do
-      describe &quot;when no constraint options are given&quot; do
-        it &quot;should destroy the parent if there are no children in the association&quot; do
-          @f1 = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-          @f2 = Farmer.create(:first_name =&gt; &quot;Some&quot;, :last_name =&gt; &quot;Body&quot;)
-          @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f2)
-          @f1.destroy.should == true
+    describe 'constraint options' do
+      describe 'when no constraint options are given' do
+        it 'should destroy the parent if there are no children in the association' do
+          @f1 = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+          @f2 = Farmer.create(:first_name =&gt; 'Some', :last_name =&gt; 'Body')
+          @c1 = Cow.create(:name =&gt; 'Bea', :farmer =&gt; @f2)
+          @f1.destroy.should be_true
         end
 
-        it &quot;should not destroy the parent if there are children in the association&quot; do
-          @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-          @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-          @f.destroy.should == false
+        it 'should not destroy the parent if there are children in the association' do
+          @f = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+          @c1 = Cow.create(:name =&gt; 'Bea', :farmer =&gt; @f)
+          @f.destroy.should be_false
         end
       end
 
-      describe &quot;when :constraint =&gt; :protect is given&quot; do
+      describe 'when :constraint =&gt; :protect is given' do
         before do
           class ::Farmer
             has n, :cows, :constraint =&gt; :protect
-            has 1, :pig, :constraint =&gt; :protect
+            has 1, :pig,  :constraint =&gt; :protect
           end
 
-          class ::Pig
-            belongs_to :farmer
+          class ::Cow
+            belongs_to :farmer, :constraint =&gt; :protect
           end
 
-          class ::Cow
-            belongs_to :farmer
+          class ::Pig
+            belongs_to :farmer, :constraint =&gt; :protect
           end
 
           class ::Chicken
@@ -157,143 +157,71 @@ ADAPTERS.each do |name,connection_uri|
           end
         end
 
-        describe &quot;one-to-one associations&quot; do
+        describe 'one-to-one associations' do
           before do
-            @f1 = Farmer.create(:first_name =&gt; &quot;Mary&quot;, :last_name =&gt; &quot;Smith&quot;)
-            @p1 = Pig.create(:name =&gt; &quot;Morton&quot;,:farmer =&gt; @f1)
+            @f1 = Farmer.create(:first_name =&gt; 'Mary', :last_name =&gt; 'Smith')
+            @p1 = Pig.create(:name =&gt; 'Morton', :farmer =&gt; @f1)
           end
 
-          it &quot;should not destroy the parent if there are children in the association&quot; do
-            @f1.destroy.should == false
+          it 'should not destroy the parent if there are children in the association' do
+            @f1.destroy.should be_false
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @p1.destroy.should == true
+          it 'the child should be destroyable' do
+            @p1.destroy.should be_true
           end
         end
 
-        describe &quot;one-to-many associations&quot; do
+        describe 'one-to-many associations' do
           before do
-            @f1 = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @f2 = Farmer.create(:first_name =&gt; &quot;Some&quot;, :last_name =&gt; &quot;Body&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f2)
+            @f1 = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+            @f2 = Farmer.create(:first_name =&gt; 'Some', :last_name =&gt; 'Body')
+            @c1 = Cow.create(:name =&gt; 'Bea', :farmer =&gt; @f2)
           end
 
-          it &quot;should destroy the parent if there are no children in the association&quot; do
-            @f1.destroy.should == true
+          it 'should destroy the parent if there are no children in the association' do
+            @f1.destroy.should be_true
           end
 
-          it &quot;should not destroy the parent if there are children in the association&quot; do
-            @f2.destroy.should == false
+          it 'should not destroy the parent if there are children in the association' do
+            @f2.destroy.should be_false
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @c1.destroy.should == true
+          it 'the child should be destroyable' do
+            @c1.destroy.should be_true
           end
         end
 
-        describe &quot;many-to-many associations&quot; do
+        describe 'many-to-many associations' do
           before do
-            pending do
-              @t1   = Tag.create(:phrase =&gt; &quot;silly chicken&quot;)
-              @t2   = Tag.create(:phrase =&gt; &quot;serious chicken&quot;)
-              @chk1 = Chicken.create(:name =&gt;&quot;Frank the Chicken&quot;, :tags =&gt; [@t2])
-            end
-          end
-
-          it &quot;should destroy the parent if there are no children in the association&quot; do
-            @t1.destroy.should == true
-          end
-
-          it &quot;should not destroy the parent if there are children in the association&quot; do
-            @t2.destroy.should == false
-          end
-
-          it &quot;the child should be destroyable&quot; do
-            @chk1.tags.clear
-            @chk1.save.should == true
-            @chk1.tags.should be_empty
-          end
-        end
-      end
-
-      describe &quot;when :constraint =&gt; :destroy! is given&quot; do
-        before do
-          class ::Farmer
-            has n, :cows, :constraint =&gt; :destroy!
-          end
-
-          class ::Cow
-            belongs_to :farmer
-          end
-
-          class ::Chicken
-            has n, :tags, :through =&gt; Resource, :constraint =&gt; :destroy!
-          end
-
-          class ::Tag
-            has n, :chickens, :through =&gt; Resource, :constraint =&gt; :destroy!
-          end
-
-          DataMapper.auto_migrate!
-        end
-
-        describe &quot;one-to-many associations&quot; do
-          before do
-            @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-            @c2 = Cow.create(:name =&gt; &quot;Riksa&quot;, :farmer =&gt; @f)
-          end
-
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
-            @f.should be_new
+            @t1   = Tag.create(:phrase =&gt; 'silly chicken')
+            @t2   = Tag.create(:phrase =&gt; 'serious chicken')
+            @chk1 = Chicken.create(:name =&gt; 'Frank the Chicken', :tags =&gt; [ @t2 ])
           end
 
-          it &quot;should destroy the children&quot; do
-            @f.destroy
-            @f.cows.all? { |c| c.should be_new }
+          it 'should destroy the parent if there are no children in the association' do
+            @t1.destroy.should be_true
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @c1.destroy.should == true
+          it 'should not destroy the parent if there are children in the association' do
+            @t2.destroy.should be_false
           end
-        end
 
-        describe &quot;many-to-many associations&quot; do
-          before do
+          it 'the child should be destroyable' do
             pending do
-              @t1   = Tag.create(:phrase =&gt; &quot;floozy&quot;)
-              @t2   = Tag.create(:phrase =&gt; &quot;dirty&quot;)
-              @chk1 = Chicken.create(:name =&gt; &quot;Nancy Chicken&quot;, :tags =&gt; [@t1, @t2])
+              @chk1.tags.clear
+              @chk1.save.should be_true
+              @chk1.tags.should be_empty
             end
           end
-
-          it &quot;should destroy! the parent and the children, too&quot; do
-            @chk1.destroy.should == true
-            @chk1.should be_new
-
-            # @t1 &amp; @t2 should still exist, the chicken_tags should have been deleted
-            ChickenTag.all.should be_empty
-            @t1.should_not be_new
-            @t2.should_not be_new
-          end
-
-          it &quot;the child should be destroyable&quot; do
-            @chk1.destroy.should == true
-          end
         end
       end
 
-      describe &quot;when :constraint =&gt; :destroy is given&quot; do
+      describe 'when :constraint =&gt; :destroy is given' do
         before do
           class ::Farmer
             has n, :cows, :constraint =&gt; :destroy
-            has 1, :pig, :constraint =&gt; :destroy
-          end
-
-          class ::Cow
-            belongs_to :farmer
+            has 1, :pig,  :constraint =&gt; :destroy
           end
 
           class ::Chicken
@@ -307,189 +235,219 @@ ADAPTERS.each do |name,connection_uri|
           DataMapper.auto_migrate!
         end
 
-        describe &quot;one-to-one associations&quot; do
+        describe 'one-to-one associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;Ted&quot;, :last_name =&gt; &quot;Cornhusker&quot;)
-            @p = Pig.create(:name =&gt; &quot;BaconBits&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'Ted', :last_name =&gt; 'Cornhusker')
+            @p = Pig.create(:name =&gt; 'BaconBits', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
           end
 
-          it &quot;should destroy the children&quot; do
+          it 'should destroy the children' do
             pig = @f.pig
-            @f.destroy
+            @f.destroy.should be_true
             pig.should be_new
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @p.destroy.should == true
+          it 'the child should be destroyable' do
+            @p.destroy.should be_true
           end
         end
 
-        describe &quot;one-to-many associations&quot; do
+        describe 'one-to-many associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-            @c2 = Cow.create(:name =&gt; &quot;Riksa&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+            @c1 = Cow.create(:name =&gt; 'Bea',   :farmer =&gt; @f)
+            @c2 = Cow.create(:name =&gt; 'Riksa', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
           end
 
-          it &quot;should destroy the children&quot; do
-            @f.destroy
+          it 'should destroy the children' do
+            @f.destroy.should be_true
             @f.cows.all? { |c| c.should be_new }
           end
 
-          it &quot;should destroy the children&quot; do
-            @f.destroy
+          it 'should destroy the children' do
+            @f.destroy.should be_true
             @f.cows.all? { |c| c.should be_new }
             @f.should be_new
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @c1.destroy.should == true
+          it 'the child should be destroyable' do
+            @c1.destroy.should be_true
           end
         end
 
-        describe &quot;many-to-many associations&quot; do
+        describe 'many-to-many associations' do
           before do
-            pending do
-              @t1   = Tag.create :phrase =&gt; &quot;floozy&quot;
-              @t2   = Tag.create :phrase =&gt; &quot;dirty&quot;
-              @chk1 = Chicken.create :name =&gt; &quot;Nancy Chicken&quot;, :tags =&gt; [@t1,@t2]
-            end
+            @t1   = Tag.create(:phrase =&gt; 'floozy')
+            @t2   = Tag.create(:phrase =&gt; 'dirty')
+            @chk1 = Chicken.create(:name =&gt; 'Nancy Chicken', :tags =&gt; [ @t1, @t2 ])
           end
 
-          it &quot;should destroy the parent and the children, too&quot; do
-            @chk1.destroy.should == true
-            @chk1.should be_new
+          it 'should destroy the parent and the children, too' do
+            pending do
+              @chk1.destroy.should be_true
+              @chk1.should be_new
 
-            #@t1 &amp; @t2 should still exist, the chicken_tags should have been deleted
-            ChickenTag.all.should be_empty
-            @t1.should_not be_new
-            @t2.should_not be_new
+              #@t1 &amp; @t2 should still exist, the chicken_tags should have been deleted
+              ChickenTag.all.should be_empty
+              @t1.should_not be_new
+              @t2.should_not be_new
+            end
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @chk1.destroy.should == true
+          it 'the child should be destroyable' do
+            pending do
+              @chk1.destroy.should be_true
+            end
           end
         end
       end
 
-      describe &quot;when :constraint =&gt; :destroy! is given&quot; do
+      describe 'when :constraint =&gt; :destroy! is given' do
         before do
           class ::Farmer
             has n, :cows, :constraint =&gt; :destroy!
           end
 
-          class ::Cow
-            belongs_to :farmer
+          class ::Chicken
+            has n, :tags, :through =&gt; Resource, :constraint =&gt; :destroy!
+          end
+
+          class ::Tag
+            has n, :chickens, :through =&gt; Resource, :constraint =&gt; :destroy!
           end
 
           DataMapper.auto_migrate!
         end
 
-        describe &quot;on deletion of the parent&quot; do
+        describe 'one-to-many associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-            @c2 = Cow.create(:name =&gt; &quot;Riksa&quot;, :farmer =&gt; @f)
+            @f  = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+            @c1 = Cow.create(:name =&gt; 'Bea',   :farmer =&gt; @f)
+            @c2 = Cow.create(:name =&gt; 'Riksa', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
           end
 
-          it &quot;should destroy the children&quot; do
-            @f.destroy
+          it 'should destroy the children' do
+            @f.destroy.should be_true
             @f.cows.all? { |c| c.should be_new }
           end
+
+          it 'the child should be destroyable' do
+            @c1.destroy.should be_true
+          end
         end
 
-        it &quot;the child should be destroyable&quot; do
-          @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-          @c = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-          @c.destroy.should == true
+        describe 'many-to-many associations' do
+          before do
+            @t1   = Tag.create(:phrase =&gt; 'floozy')
+            @t2   = Tag.create(:phrase =&gt; 'dirty')
+            @chk1 = Chicken.create(:name =&gt; 'Nancy Chicken', :tags =&gt; [ @t1, @t2 ])
+          end
+
+          it 'should destroy! the parent and the children, too' do
+            pending do
+              @chk1.destroy.should be_true
+              @chk1.should be_new
+
+              # @t1 &amp; @t2 should still exist, the chicken_tags should have been deleted
+              ChickenTag.all.should be_empty
+              @t1.should_not be_new
+              @t2.should_not be_new
+            end
+          end
+
+          it 'the child should be destroyable' do
+            pending do
+              @chk1.destroy.should be_true
+            end
+          end
         end
       end
 
-      describe &quot;when :constraint =&gt; :set_nil is given&quot; do
+      describe 'when :constraint =&gt; :set_nil is given' do
         before do
           class ::Farmer
             has n, :cows, :constraint =&gt; :set_nil
-            has 1, :pig, :constraint =&gt; :set_nil
-          end
-
-          class ::Cow
-            belongs_to :farmer
+            has 1, :pig,  :constraint =&gt; :set_nil
           end
 
           # NOTE: M:M Relationships are not supported,
-          # see &quot;when checking constraint types&quot; tests at bottom
+          # see 'when checking constraint types' tests at bottom
           DataMapper.auto_migrate!
         end
 
-        describe &quot;one-to-one associations&quot; do
+        describe 'one-to-one associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;Mr&quot;, :last_name =&gt; &quot;Hands&quot;)
-            @p = Pig.create(:name =&gt; &quot;Greasy&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'Mr', :last_name =&gt; 'Hands')
+            @p = Pig.create(:name =&gt; 'Greasy', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
           end
 
           it &quot;should set the child's foreign_key id to nil&quot; do
             pig = @f.pig
-            @f.destroy.should == true
+            @f.destroy.should be_true
             pig.farmer.should be_nil
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @p.destroy.should == true
+          it 'the child should be destroyable' do
+            @p.destroy.should be_true
           end
         end
 
-        describe &quot;one-to-many associations&quot; do
+        describe 'one-to-many associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-            @c2 = Cow.create(:name =&gt; &quot;Riksa&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+            @c1 = Cow.create(:name =&gt; 'Bea',   :farmer =&gt; @f)
+            @c2 = Cow.create(:name =&gt; 'Riksa', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
           end
 
-          it &quot;should set the foreign_key ids of children to nil&quot; do
-            @f.destroy
+          it 'should set the foreign_key ids of children to nil' do
+            @f.destroy.should be_true
             @f.cows.all? { |c| c.farmer.should be_nil }
           end
 
-          it &quot;the children should be destroyable&quot; do
-            @c1.destroy.should == true
-            @c2.destroy.should == true
+          it 'the children should be destroyable' do
+            @c1.destroy.should be_true
+            @c2.destroy.should be_true
           end
         end
       end
 
-      describe &quot;when :constraint =&gt; :skip is given&quot; do
+      describe 'when :constraint =&gt; :skip is given' do
         before do
           class ::Farmer
             has n, :cows, :constraint =&gt; :skip
-            has 1, :pig, :constraint =&gt; :skip
+            has 1, :pig,  :constraint =&gt; :skip
           end
 
           class ::Cow
-            belongs_to :farmer
+            belongs_to :farmer, :constraint =&gt; :skip
+          end
+
+          class ::Pig
+            belongs_to :farmer, :constraint =&gt; :skip
           end
 
           class ::Chicken
@@ -503,67 +461,67 @@ ADAPTERS.each do |name,connection_uri|
           DataMapper.auto_migrate!
         end
 
-        describe &quot;one-to-one associations&quot; do
+        describe 'one-to-one associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;William&quot;, :last_name =&gt; &quot;Shepard&quot;)
-            @p  = Pig.create(:name =&gt; &quot;Jiggles The Pig&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'William', :last_name =&gt; 'Shepard')
+            @p = Pig.create(:name =&gt; 'Jiggles The Pig', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
             @p.farmer.should be_new
           end
 
-          it &quot;should let the children become orphan records&quot; do
-            @f.destroy
+          it 'should let the children become orphan records' do
+            @f.destroy.should be_true
             @p.farmer.should be_new
           end
 
-          it &quot;the child should be destroyable&quot; do
-            @p.destroy.should == true
+          it 'the child should be destroyable' do
+            @p.destroy.should be_true
           end
         end
 
-        describe &quot;one-to-many associations&quot; do
+        describe 'one-to-many associations' do
           before do
-            @f = Farmer.create(:first_name =&gt; &quot;John&quot;, :last_name =&gt; &quot;Doe&quot;)
-            @c1 = Cow.create(:name =&gt; &quot;Bea&quot;, :farmer =&gt; @f)
-            @c2 = Cow.create(:name =&gt; &quot;Riksa&quot;, :farmer =&gt; @f)
+            @f = Farmer.create(:first_name =&gt; 'John', :last_name =&gt; 'Doe')
+            @c1 = Cow.create(:name =&gt; 'Bea',   :farmer =&gt; @f)
+            @c2 = Cow.create(:name =&gt; 'Riksa', :farmer =&gt; @f)
           end
 
-          it &quot;should let the parent to be destroyed&quot; do
-            @f.destroy.should == true
+          it 'should let the parent to be destroyed' do
+            @f.destroy.should be_true
             @f.should be_new
           end
 
-          it &quot;should let the children become orphan records&quot; do
-            @f.destroy
+          it 'should let the children become orphan records' do
+            @f.destroy.should be_true
             @c1.farmer.should be_new
             @c2.farmer.should be_new
           end
 
-          it &quot;the children should be destroyable&quot; do
-            @c1.destroy.should == true
-            @c2.destroy.should == true
+          it 'the children should be destroyable' do
+            @c1.destroy.should be_true
+            @c2.destroy.should be_true
           end
         end
 
-        describe &quot;many-to-many associations&quot; do
+        describe 'many-to-many associations' do
           before do
-            pending do
-              @t = Tag.create(:phrase =&gt; &quot;Richard Pryor's Chicken&quot;)
-              @chk = Chicken.create(:name =&gt; &quot;Delicious&quot;, :tags =&gt; [@t])
-            end
+            @t = Tag.create(:phrase =&gt; &quot;Richard Pryor's Chicken&quot;)
+            @chk = Chicken.create(:name =&gt; 'Delicious', :tags =&gt; [ @t ])
           end
 
-          it &quot;the children should be destroyable&quot; do
-            @chk.destroy.should == true
+          it 'the children should be destroyable' do
+            pending do
+              @chk.destroy.should be_true
+            end
           end
         end
       end
 
-      describe &quot;when checking constraint types&quot; do
+      describe 'when checking constraint types' do
 
         #M:M relationships results in a join table composed of a two part primary key
         # setting a portion of the primary key is not possible for two reasons:
@@ -590,7 +548,7 @@ ADAPTERS.each do |name,connection_uri|
         #
         #   I would suggest setting :constraint to :skip in this scenario which will leave
         #     you with orphaned rows.
-        it &quot;should raise an error if :set_nil is given for a M:M relationship&quot; do
+        it 'should raise an error if :set_nil is given for a M:M relationship' do
           lambda{
             class ::Chicken
               has n, :tags, :through =&gt; Resource, :constraint =&gt; :set_nil
@@ -602,7 +560,7 @@ ADAPTERS.each do |name,connection_uri|
         end
 
         # Resource#destroy! is not suppored in dm-core
-        it &quot;should raise an error if :destroy! is given for a 1:1 relationship&quot; do
+        it 'should raise an error if :destroy! is given for a 1:1 relationship' do
           lambda do
             class ::Farmer
               has 1, :pig, :constraint =&gt; :destroy!
@@ -610,7 +568,7 @@ ADAPTERS.each do |name,connection_uri|
           end.should raise_error(ArgumentError)
         end
 
-        it &quot;should raise an error if an unknown type is given&quot; do
+        it 'should raise an error if an unknown type is given' do
           lambda do
             class ::Farmer
               has n, :cows, :constraint =&gt; :chocolate</diff>
      <filename>dm-constraints/spec/integration/constraints_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3b6666799a49d2d470de860b78adba56ab39d62e</id>
    </parent>
  </parents>
  <author>
    <name>Dan Kubb</name>
    <email>dan.kubb@gmail.com</email>
  </author>
  <url>http://github.com/datamapper/dm-more/commit/af6fde8a6982990a1298d15caa85ca177acb7046</url>
  <id>af6fde8a6982990a1298d15caa85ca177acb7046</id>
  <committed-date>2009-05-12T08:15:43-07:00</committed-date>
  <authored-date>2009-05-12T08:01:33-07:00</authored-date>
  <message>[dm-constraints] Updated to pass specs with dm-core 0.10</message>
  <tree>9d2b0a12e9a92e3a51348b4451a76d4e126eed76</tree>
  <committer>
    <name>Dan Kubb</name>
    <email>dan.kubb@gmail.com</email>
  </committer>
</commit>
