Use better and clearer shorthand for callbacks
This commit is contained in:
parent
d938e3d330
commit
a2bd73ed16
1 changed files with 3 additions and 2 deletions
|
|
@ -80,8 +80,9 @@ class User < ApplicationRecord
|
||||||
|
|
||||||
after_save :touch_events
|
after_save :touch_events
|
||||||
|
|
||||||
after_commit :mailbluster_create_lead, on: :create
|
after_create_commit :mailbluster_create_lead
|
||||||
after_commit :mailbluster_delete_lead, on: :destroy
|
after_destory_commit :mailbluster_delete_lead
|
||||||
|
after_update_commit :mailbluster_update_email, if: :saved_change_to_email?
|
||||||
|
|
||||||
# add scope
|
# 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)}
|
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue