Created
August 30, 2010 20:02
-
-
Save raykrueger/557958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/queued_message.rb b/lib/queued_message.rb | |
index 83213e0..95eaa10 100644 | |
--- a/lib/queued_message.rb | |
+++ b/lib/queued_message.rb | |
@@ -6,7 +6,7 @@ require 'mq' | |
class QueuedMessage | |
include ActiveSupport::Callbacks | |
- define_callbacks :after_initialize | |
+ define_callbacks :after_initialize, :after_publish | |
superclass_delegating_accessor :connection_settings | |
self.connection_settings = {} | |
@@ -225,6 +225,7 @@ class QueuedMessage | |
def publish(publish_options = {}) | |
do_publish(self.to_wire_format, self.class.default_publish_options.merge(publish_options)) | |
+ run_callbacks(:after_publish) | |
end | |
def to_wire_format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment