<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -90,15 +90,18 @@ module ObjectDaddy
     
     def gather_exemplars
       return if exemplars_generated
+      
+      self.generators ||= {}
       if superclass.respond_to?(:gather_exemplars)
         superclass.gather_exemplars
-        self.generators = (superclass.generators || {}).dup
+        self.generators = (superclass.generators).merge(generators).dup
       end
 
       exemplar_path.each do |raw_path|
         path = File.join(raw_path, &quot;#{underscore(name)}_exemplar.rb&quot;)
         load(path) if File.exists?(path)
       end
+      
       self.exemplars_generated = true
     end
     </diff>
      <filename>lib/object_daddy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -506,7 +506,7 @@ describe ObjectDaddy, &quot;when spawning a class instance&quot; do
         SubWidget.stubs(:exemplar_path).returns(@subfile_path)
         
         File.open(@file_name, 'w') do |f|
-          f.puts &quot;class Widget\ngenerator_for :blah do |prev| 'blah'; end\nend\n&quot;
+          f.puts &quot;class Widget\ngenerator_for :blah do |prev| 'blah'; end\ngenerator_for :other do |prev| 'bang'; end\nend\n&quot;
         end
       end
       
@@ -516,17 +516,27 @@ describe ObjectDaddy, &quot;when spawning a class instance&quot; do
       end
       
       it 'should use generators from the parent class' do
-        SubWidget.spawn.blah.should == 'blah'
+        SubWidget.spawn.other.should == 'bang'
+        SubWidget.spawn.blah.should  == 'blah'
       end
       
-      it 'should let subclass generators override parent generators' do
-        File.open(@subfile_name, 'w') do |f|
-          f.puts &quot;class SubWidget\ngenerator_for :blah do |prev| 'blip'; end\nend\n&quot;
+      describe 'with subclass generators' do
+        before :each do
+          File.open(@subfile_name, 'w') do |f|
+            f.puts &quot;class SubWidget\ngenerator_for :blah do |prev| 'blip'; end\nend\n&quot;
+          end
+        end
+        
+        it 'should still use generators from the parent class' do
+          SubWidget.spawn.other.should == 'bang'
+        end
+        
+        it 'should allow overriding parent generators' do
+          SubWidget.spawn.blah.should == 'blip'
         end
-        SubWidget.spawn.blah.should == 'blip'
       end
     end
-
+    
     describe 'using generators called directly' do
       it 'should use generators from the parent class' do
         @class.generator_for :blah do |prev| 'blah'; end</diff>
      <filename>spec/object_daddy_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>87d26597ffc3325a6ef19623eb7e9a5a0b2bc945</id>
    </parent>
  </parents>
  <author>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </author>
  <url>http://github.com/flogic/object_daddy/commit/28da67223f89c16f34c58fb149ea03c77ddd8b32</url>
  <id>28da67223f89c16f34c58fb149ea03c77ddd8b32</id>
  <committed-date>2009-07-27T22:57:45-07:00</committed-date>
  <authored-date>2009-07-27T22:57:45-07:00</authored-date>
  <message>Keeping superclass generators when overriding some.

Fix proposed by Valdis (http://github.com/valdis/object_daddy/commit/9f8054f798e3794796c2824e2c77cf0e91a2aa71)
Made complete, correct, and tested.</message>
  <tree>f73c2df397d74053258d37951ad0e3615bb756de</tree>
  <committer>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </committer>
</commit>
