Skip to content

Instantly share code, notes, and snippets.

@raykrueger
Created August 30, 2010 20:02
Show Gist options
  • Save raykrueger/557958 to your computer and use it in GitHub Desktop.
Save raykrueger/557958 to your computer and use it in GitHub Desktop.
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