title: rails 3.1.3 has_many/belongs_to fixtures are not equal?
body: <p>Assume two models:</p>
  
  <pre><code>class Foo &lt; ActiveRecord::Base
    has_many :bars
  end
  
  class Bar &lt; ActiveRecord::Base
    belongs_to :foo
  end
  </code></pre>
  
  <p>and their associated fixtures:</p>
  
  <p>foos.yml:</p>
  
  <pre><code>one:
    ...
  </code></pre>
  
  <p>bars.yml:</p>
  
  <pre><code>one:
    foo: one
  
  two:
    foo: one
  </code></pre>
  
  <p>And then a testcase:</p>
  
  <pre><code>test "fixtures equal?" do
    foo = foos(:one)
    assert_equal foo, foo.bars.first.foo
  end
  </code></pre>
  
  <p>This test fails for me in both the unit test framework and the functional test framework.   The failure I get looks like:</p>
  
  <pre><code>1) Failure:
  test_fixtures_equal?(FooUnitTest) [test/unit/foo_test.rb:53]:
  &lt;#&lt;Foo id: 980190962, created_at: "2012-05-18 21:47:27", updated_at: "2012-05-18 21:47:27"&gt;&gt;
  with id &lt;70029939109360&gt; expected to be equal? to
  &lt;#&lt;Foo id: 980190962, created_at: "2012-05-18 21:47:27", updated_at: "2012-05-18 21:47:27"&gt;&gt;
  with id &lt;70029939309000&gt;.
  </code></pre>
  
  <p>What am I doing wrong?  How do I get the forward and backward pointers to point the same objects?  This is being particularly important to me because I'm trying to modify both objects simultaneously and validating the changes, but the bar.foo linkage isn't seeing changes to the "parent" foo object so my validations are failing during the tests.</p>
  
  <p>Alas, after searching for a few hours I trying many different approaches I have not been able to figure this one out.</p>
  
  <p>Thanks!</p>