don't send devise notifications to the ghost user

This commit is contained in:
http://jneen.net/ 2017-08-10 13:13:09 -07:00
parent cc4f77c632
commit 8f6205d144

View file

@ -1069,6 +1069,7 @@ class User < ActiveRecord::Base
# Added according to https://github.com/plataformatec/devise/blob/7df57d5081f9884849ca15e4fde179ef164a575f/README.md#activejob-integration
def send_devise_notification(notification, *args)
return true unless can?(:receive_notifications)
devise_mailer.send(notification, self, *args).deliver_later
end