Created
October 30, 2013 21:13
-
-
Save beck03076/7240380 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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