From b357d13c39eddc8dd60c17b0e68dd8a2256d7cce Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Thu, 25 Mar 2021 16:44:51 -0700 Subject: [PATCH] Use better and clearer shorthand for callbacks --- app/models/user.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 87f5eb73..04f51c4c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -80,8 +80,9 @@ class User < ApplicationRecord after_save :touch_events - after_commit :mailbluster_create_lead, on: :create - after_commit :mailbluster_delete_lead, on: :destroy + after_create_commit :mailbluster_create_lead + after_destory_commit :mailbluster_delete_lead + after_update_commit :mailbluster_update_email, if: :saved_change_to_email? # add scope scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}