README.md in devise-async-0.3.1 vs README.md in devise-async-0.4.0

- old
+ new

@@ -24,39 +24,37 @@ $ gem install devise-async ## Usage -### Devise >= 2.1.1 +Add `:async` to the `devise` call in your model: -Include `Devise::Async::Model` to your Devise model - ```ruby class User < ActiveRecord::Base - devise :database_authenticatable, :confirmable # etc ... - - include Devise::Async::Model # should be below call to `devise` + devise :database_authenticatable, :async, :confirmable # etc ... end ``` +Set your queuing backend by creating `config/initializers/devise_async.rb`: + +```ruby +# Supported options: :resque, :sidekiq, :delayed_job +Devise::Async.backend = :resque +``` + +Tip: it defaults to Resque. You don't need to create the initializer if using it. + ### Devise < 2.1.1 Set `Devise::Async::Proxy` as Devise's mailer in `config/initializers/devise.rb`: ```ruby # Configure the class responsible to send e-mails. config.mailer = "Devise::Async::Proxy" ``` -### All -Set your queuing backend by creating `config/initializers/devise_async.rb`: - -```ruby -# Supported options: :resque, :sidekiq, :delayed_job -Devise::Async.backend = :resque -``` - -Tip: it defaults to Resque. You don't need to create the initializer if using it. +Note: before devise 2.1.1 devise-async had issues with background jobs trying to run +before the record was committed to the DB if the creation was transactioned. ## Advanced Options ### Custom mailer class