removes devise-async for delayed devise emails

Custom overwrite of the devise implementation following
https://github.com/plataformatec/devise#activejob-integration
This commit is contained in:
alejandro
2017-04-06 16:52:25 +02:00
committed by Julian Herrero
parent 23fcd78e6c
commit 84338592da
2 changed files with 13 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ class User < ActiveRecord::Base
include Verification include Verification
devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
:trackable, :validatable, :omniauthable, :async, :password_expirable, :secure_validatable, :trackable, :validatable, :omniauthable, :password_expirable, :secure_validatable,
authentication_keys: [:login] authentication_keys: [:login]
acts_as_voter acts_as_voter
@@ -346,6 +346,10 @@ class User < ActiveRecord::Base
followables.compact.map { |followable| followable.tags.map(&:name) }.flatten.compact.uniq followables.compact.map { |followable| followable.tags.map(&:name) }.flatten.compact.uniq
end end
def send_devise_notification(notification, *args)
devise_mailer.send(notification, self, *args).deliver_later
end
private private
def clean_document_number def clean_document_number

View File

@@ -1,8 +1,8 @@
Devise::Async.setup do |config| # Devise::Async.setup do |config|
if Rails.env.test? || Rails.env.development? # if Rails.env.test? || Rails.env.development?
config.enabled = false # config.enabled = false
else # else
config.enabled = true # config.enabled = true
end # end
config.backend = :delayed_job # config.backend = :delayed_job
end # end