Skip to content

Instantly share code, notes, and snippets.

@beck03076
Created October 30, 2013 21:13
Show Gist options
  • Save beck03076/7240380 to your computer and use it in GitHub Desktop.
Save beck03076/7240380 to your computer and use it in GitHub Desktop.
class NotificationObserver < ActiveRecord::Observer
observe :enquiry,:registration,:todo,:follow_up
def after_save(record)
if record.assigned_to != record.assigned_by
PrivatePub.publish_to("/notify/" + record.assigned_to.to_s,
message: "#{record.class.name} has been assigned to you",
ass_by: record.assigned_by)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment