Skip to content

Instantly share code, notes, and snippets.

View tyrauber's full-sized avatar

Ty Rauber tyrauber

View GitHub Profile
# config/initializer/notification_center.rb
NotificationCenter.queue
NotificationCenter.thread
ActiveSupport::Notifications.subscribe /(.)+\.notification/i do |*args|
NotificationCenter.queue << args
end
@tyrauber
tyrauber / create_triggers
Created November 27, 2018 23:28 — forked from colophonemes/create_triggers
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',