mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Remove ActionMailer/ActiveJob deprecation.
This commit is contained in:
parent
13eebb6b76
commit
c25312e78e
2 changed files with 19 additions and 1 deletions
12
README.md
12
README.md
|
@ -471,6 +471,18 @@ Alternatively, you can simply run the Devise generator.
|
|||
|
||||
Keep in mind that those models will have completely different routes. They **do not** and **cannot** share the same controller for sign in, sign out and so on. In case you want to have different roles sharing the same actions, we recommend you to use a role-based approach, by either providing a role column or using a dedicated gem for authorization.
|
||||
|
||||
### ActiveJob Integration
|
||||
|
||||
If you are using Rails 4.2 and ActiveJob to deliver ActionMailer messages in the
|
||||
background through a queueing backend, you can send Devise emails through your
|
||||
existing queue by overriding the `send_devise_notification` method in your model.
|
||||
|
||||
```ruby
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
end
|
||||
```
|
||||
|
||||
### Other ORMs
|
||||
|
||||
Devise supports ActiveRecord (default) and Mongoid. To choose other ORM, you just need to require it in the initializer file.
|
||||
|
|
|
@ -170,7 +170,13 @@ module Devise
|
|||
# end
|
||||
#
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver
|
||||
message = devise_mailer.send(notification, self, *args)
|
||||
# Remove once we move to Rails 4.2+ only.
|
||||
if message.respond_to?(:deliver_now)
|
||||
message.deliver_now
|
||||
else
|
||||
message.deliver
|
||||
end
|
||||
end
|
||||
|
||||
def downcase_keys
|
||||
|
|
Loading…
Add table
Reference in a new issue