<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -146,6 +146,13 @@ module DataMapper
     # @api public
     def belongs_to(name, options={})
       @_valid_relations = false
+
+      if options.key?(:class_name) &amp;&amp; !options.key?(:child_key)
+        warn &quot;The inferred child_key will changing to be prefixed with the relationship name #{name}. &quot; \
+          &quot;When using :class_name in belongs_to specify the :child_key explicitly to avoid problems.&quot; \
+          &quot;#{caller(0)[1]}&quot;
+      end
+
       relationship = ManyToOne.setup(name, self, options)
       # Please leave this in - I will release contextual serialization soon
       # which requires this -- guyvdb</diff>
      <filename>lib/dm-core/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,7 +67,7 @@ module DataMapper
           EOS
 
           names.each do |n|
-            model.belongs_to(Extlib::Inflection.underscore(n).gsub(&quot;/&quot;, &quot;_&quot;).to_sym, :class_name =&gt; n)
+            model.belongs_to(Extlib::Inflection.underscore(n).gsub('/', '_').to_sym)
           end
 
           Object.const_set(model_name, model)</diff>
      <filename>lib/dm-core/associations/many_to_many.rb</filename>
    </modified>
    <modified>
      <diff>@@ -231,11 +231,11 @@ describe &quot;DataMapper::Associations&quot; do
 
     it &quot;should create a many-to-one association with options&quot; do
       DataMapper::Associations::ManyToOne.should_receive(:setup).
-        with(:vehicle, Manufacturer, { :class_name =&gt; 'Car' }).
+        with(:vehicle, Manufacturer, :class_name =&gt; 'Car', :child_key =&gt; [ :car_id ]).
         and_return(@relationship)
 
       class ::Manufacturer
-        belongs_to(:vehicle, :class_name =&gt; 'Car').should == mock_relationship
+        belongs_to(:vehicle, :class_name =&gt; 'Car', :child_key =&gt; [ :car_id ]).should == mock_relationship
       end
     end
   end</diff>
      <filename>spec/unit/associations_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8153992ffcc7243aad6a1ee6b5cdfefe5befa4c1</id>
    </parent>
  </parents>
  <author>
    <name>Dan Kubb</name>
    <email>dan.kubb@autopilotmarketing.com</email>
  </author>
  <url>http://github.com/sam/dm-core/commit/61e7fa5261a30b0579e444ec86213a3722f7cb9f</url>
  <id>61e7fa5261a30b0579e444ec86213a3722f7cb9f</id>
  <committed-date>2009-01-23T01:59:56-08:00</committed-date>
  <authored-date>2009-01-23T01:59:56-08:00</authored-date>
  <message>Added deprecation warning for inferred child_key naming convention change</message>
  <tree>91430f64ac203daf3119dc7803dd40ceabfa3c1f</tree>
  <committer>
    <name>Dan Kubb</name>
    <email>dan.kubb@autopilotmarketing.com</email>
  </committer>
</commit>
