<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -37,12 +37,18 @@ class Version &lt; ActiveRecord::Base
 
       # Associations
 
-      # set the reified model's has_one associations to the current item's if possible.
+      # Set the reified model's has_one associations to the current item's if possible.
       # NOTE: with this implementation we can't restore a destroyed item's associations.
-      # TODO: test
       if item
         klass.send(:reflect_on_all_associations, :has_one).map(&amp;:name).each do |assoc|
-          model.send &quot;#{assoc}=&quot;, item.send(assoc)
+          # The only way to assign an object to a has_one association without saving
+          # it is to use +build_association(attributes = {})+.
+          associated = item.send assoc
+          model.send &quot;build_#{assoc}&quot;, associated.attributes if associated
+        end
+
+        klass.send(:reflect_on_all_associations, :has_many).map(&amp;:name).each do |assoc|
+          #model.send &quot;#{assoc}=&quot;, item.send(assoc)
         end
       end
 </diff>
      <filename>lib/paper_trail/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,8 +78,13 @@ class HasPaperTrailModelTest &lt; Test::Unit::TestCase
         context 'and has one associated object' do
           setup { @wotsit = @widget.create_wotsit :name =&gt; 'John' }
 
-          should 'preserve the association when reified' do
-            assert_equal @wotsit, @widget.versions.last.reify.wotsit
+          should 'not save the associated object when reifying' do
+            assert_nil @widget.versions.last.reify.wotsit.id
+          end
+
+          should &quot;preserve the associated object's values when reifying&quot; do
+            assert_equal @wotsit.attributes.reject{ |k,v| k == 'id' },
+              @widget.versions.last.reify.wotsit.attributes.reject{ |k,v| k == 'id'}
           end
         end
 </diff>
      <filename>test/paper_trail_model_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a4300d4d98acbf8cbe60808ad32602602b6ac45d</id>
    </parent>
  </parents>
  <author>
    <name>Andy Stewart</name>
    <email>boss@airbladesoftware.com</email>
  </author>
  <url>http://github.com/airblade/paper_trail/commit/86f89faf3b3fb577459c8fd91c5e83270af479d6</url>
  <id>86f89faf3b3fb577459c8fd91c5e83270af479d6</id>
  <committed-date>2009-06-18T02:30:33-07:00</committed-date>
  <authored-date>2009-06-18T02:30:33-07:00</authored-date>
  <message>Don't save an object when associating it to reified model.</message>
  <tree>9dbc9b1eb34db5e37a2c6782f1737114ddebc630</tree>
  <committer>
    <name>Andy Stewart</name>
    <email>boss@airbladesoftware.com</email>
  </committer>
</commit>
