<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.1.1 (next release)*
 
+* Run callbacks from object's metaclass [Josh Peek]
+
 * TimeWithZone: when crossing DST boundary, treat Durations of days, months or years as variable-length, and all other values as absolute length. A time + 24.hours will advance exactly 24 hours, but a time + 1.day will advance 23-25 hours, depending on the day. Ensure consistent behavior across all advancing methods [Geoff Buesing]
 
 * Fix TimeWithZone unmarshaling: coerce unmarshaled Time instances to utc, because Ruby's marshaling of Time instances doesn't respect the zone [Geoff Buesing]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -269,7 +269,15 @@ module ActiveSupport
     #   pass
     #   stop
     def run_callbacks(kind, options = {}, &amp;block)
-      self.class.send(&quot;#{kind}_callback_chain&quot;).run(self, options, &amp;block)
+      callback_chain_method = &quot;#{kind}_callback_chain&quot;
+
+      # Meta class inherits Class so we don't have to merge it in 1.9
+      if RUBY_VERSION &gt;= '1.9'
+        metaclass.send(callback_chain_method).run(self, options, &amp;block)
+      else
+        callbacks = self.class.send(callback_chain_method) | metaclass.send(callback_chain_method)
+        callbacks.run(self, options, &amp;block)
+      end
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -84,6 +84,30 @@ class CallbacksTest &lt; Test::Unit::TestCase
   end
 end
 
+class MetaclassCallbacksTest &lt; Test::Unit::TestCase
+  module ModuleWithCallbacks
+    def self.extended(object)
+      object.metaclass.before_save :raise_metaclass_callback_called
+    end
+
+    def module_callback_called?
+      @module_callback_called ||= false
+    end
+
+    def raise_metaclass_callback_called
+      @module_callback_called = true
+    end
+  end
+
+  def test_metaclass_callbacks
+    person = Person.new
+    person.extend(ModuleWithCallbacks)
+    assert !person.module_callback_called?
+    person.save
+    assert person.module_callback_called?
+  end
+end
+
 class ConditionalCallbackTest &lt; Test::Unit::TestCase
   def test_save_conditional_person
     person = ConditionalPerson.new</diff>
      <filename>activesupport/test/callbacks_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>98dd7226fa2fb306008fb5d89e38ac2391453664</id>
    </parent>
  </parents>
  <author>
    <name>Joshua Peek</name>
    <login>josh</login>
    <email>josh@joshpeek.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/e0846c8417093853f4f7f62732983e990c28d669</url>
  <id>e0846c8417093853f4f7f62732983e990c28d669</id>
  <committed-date>2008-07-15T19:58:52-07:00</committed-date>
  <authored-date>2008-07-15T19:58:52-07:00</authored-date>
  <message>Run callbacks from object's metaclass</message>
  <tree>6dfa45ce6048591d54389bc0f63977850cbdeff7</tree>
  <committer>
    <name>Joshua Peek</name>
    <login>josh</login>
    <email>josh@joshpeek.com</email>
  </committer>
</commit>
