<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,8 +36,10 @@ module Merger
     
     def merge!
       keep.class.transaction do
+        duplicates.each {|duplicate| duplicate.send(:before_merge, keep) if duplicate.respond_to?(:before_merge) }
         associations!
-        duplicates.each {|duplicate| duplicate.send(:merged_with, keep) if duplicate.respond_to?(:merged_with) }
+        duplicates.each {|duplicate| duplicate.send(:after_merge, keep) if duplicate.respond_to?(:after_merge) }
+        
         duplicates.each(&amp;:destroy) if options[:destroy]
       end
     end</diff>
      <filename>lib/merger/merge.rb</filename>
    </modified>
    <modified>
      <diff>@@ -75,8 +75,9 @@ class Merger::MergeTest &lt; Test::Unit::TestCase
     assert_not_nil Person.find_by_id(people(:duplicate).id)
   end
   
-  def test_merged_with_callback
-    people(:duplicate).expects(:merged_with).with(people(:original))
+  def test_callback
+    people(:duplicate).expects(:before_merge).with(people(:original))
+    people(:duplicate).expects(:after_merge).with(people(:original))
     @merge.merge!
   end
 end
\ No newline at end of file</diff>
      <filename>test/merger/merge_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>32f2fbc133daf31a849f3152e1c512895faad120</id>
    </parent>
  </parents>
  <author>
    <name>Jean-Francois Couture</name>
    <email>jfcouture@gmail.com</email>
  </author>
  <url>http://github.com/collectiveidea/merger/commit/079099b5e134ad40b00eed58b780923081560155</url>
  <id>079099b5e134ad40b00eed58b780923081560155</id>
  <committed-date>2009-04-24T06:13:43-07:00</committed-date>
  <authored-date>2009-04-17T13:30:59-07:00</authored-date>
  <message>changed callbacks:

- renamed merged_with to after_merge
- added before_merge callback, if you want to handle part of the merge manually</message>
  <tree>a0a40126a01080724c864f07c87a999312a127bb</tree>
  <committer>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </committer>
</commit>
