<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 === HEAD
 
+* Use save_changes instead of save when updating existing associated objects in the nested_attributes plugin (jeremyevans)
+
 * Allow Model#save_changes to accept an option hash that is passed to save, so you can save changes without validating (jeremyevans)
 
 * Make nested_attributes plugin add newly created objects to cached association array immediately (jeremyevans)</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -180,7 +180,7 @@ module Sequel
             after_validation_hook{validate_associated_object(reflection, obj)}
             # Don't need to validate the object twice if :validate association option is not false
             # and don't want to validate it at all if it is false.
-            after_save_hook{obj.save(:validate=&gt;false)}
+            after_save_hook{obj.save_changes(:validate=&gt;false)}
             obj
           end
         end</diff>
      <filename>lib/sequel/plugins/nested_attributes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -346,7 +346,7 @@ describe &quot;NestedAttributes plugin&quot; do
     al.set(:tags_attributes=&gt;[{:id=&gt;30, :name=&gt;'T2'}, {:name=&gt;'T3'}])
     @mods.should == []
     al.save
-    @mods.should == [[:u, :albums, {:name=&gt;'Al'}, '(id = 10)'], [:u, :tags, {:name=&gt;'T2', :number=&gt;10}, '(id = 30)'], [:is, :tags, {:name=&gt;&quot;T3&quot;}, 1], [:i, :at, {:album_id=&gt;10, :tag_id=&gt;1}, 2]]
+    @mods.should == [[:u, :albums, {:name=&gt;'Al'}, '(id = 10)'], [:u, :tags, {:name=&gt;'T2'}, '(id = 30)'], [:is, :tags, {:name=&gt;&quot;T3&quot;}, 1], [:i, :at, {:album_id=&gt;10, :tag_id=&gt;1}, 2]]
     proc{al.set(:tags_attributes=&gt;[{:id=&gt;30, :name=&gt;'T2', :number=&gt;3}])}.should raise_error(Sequel::Error)
     proc{al.set(:tags_attributes=&gt;[{:name=&gt;'T2', :number=&gt;3}])}.should raise_error(Sequel::Error)
   end</diff>
      <filename>spec/extensions/nested_attributes_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9738b08e97d930a871f5c221039eb5ab12b01e0f</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </author>
  <url>http://github.com/jeremyevans/sequel/commit/fec5c0ad569f092a1e88c079cdab882eba679c84</url>
  <id>fec5c0ad569f092a1e88c079cdab882eba679c84</id>
  <committed-date>2009-10-29T09:23:13-07:00</committed-date>
  <authored-date>2009-10-29T09:23:13-07:00</authored-date>
  <message>Use save_changes instead of save when updating existing associated objects in the nested_attributes plugin

This should be significantly faster for the case where you are
displaying a complex form to the user, and they make no changes to
the existing associated records when they submit it.

This shouldn't have a negative effect on production code, unless
save_changes doesn't work correctly for the associated objects.
It may break test code that checks for specific SQL or columns in
the update statement.</message>
  <tree>1e7f26152fdb21e4e820109942f176ce103cfc06</tree>
  <committer>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </committer>
</commit>
