Commit f7ef23e41210a43d75fe3255562792be3636f849
1 parent
551fa4c9
Exists in
master
and in
4 other branches
Send devise emails async
Showing
4 changed files
with
7 additions
and
2 deletions
Show diff stats
Gemfile
| @@ -16,6 +16,7 @@ gem "pg", group: :postgres | @@ -16,6 +16,7 @@ gem "pg", group: :postgres | ||
| 16 | 16 | ||
| 17 | # Auth | 17 | # Auth |
| 18 | gem "devise", '~> 2.2' | 18 | gem "devise", '~> 2.2' |
| 19 | +gem "devise-async" | ||
| 19 | gem 'omniauth', "~> 1.1.3" | 20 | gem 'omniauth', "~> 1.1.3" |
| 20 | gem 'omniauth-google-oauth2' | 21 | gem 'omniauth-google-oauth2' |
| 21 | gem 'omniauth-twitter' | 22 | gem 'omniauth-twitter' |
Gemfile.lock
| @@ -106,6 +106,8 @@ GEM | @@ -106,6 +106,8 @@ GEM | ||
| 106 | orm_adapter (~> 0.1) | 106 | orm_adapter (~> 0.1) |
| 107 | railties (~> 3.1) | 107 | railties (~> 3.1) |
| 108 | warden (~> 1.2.1) | 108 | warden (~> 1.2.1) |
| 109 | + devise-async (0.8.0) | ||
| 110 | + devise (>= 2.2, < 3.2) | ||
| 109 | diff-lcs (1.2.4) | 111 | diff-lcs (1.2.4) |
| 110 | dotenv (0.8.0) | 112 | dotenv (0.8.0) |
| 111 | email_spec (1.4.0) | 113 | email_spec (1.4.0) |
| @@ -564,6 +566,7 @@ DEPENDENCIES | @@ -564,6 +566,7 @@ DEPENDENCIES | ||
| 564 | d3_rails (~> 3.1.4) | 566 | d3_rails (~> 3.1.4) |
| 565 | database_cleaner | 567 | database_cleaner |
| 566 | devise (~> 2.2) | 568 | devise (~> 2.2) |
| 569 | + devise-async | ||
| 567 | email_spec | 570 | email_spec |
| 568 | enumerize | 571 | enumerize |
| 569 | factory_girl_rails | 572 | factory_girl_rails |
app/models/user.rb
| @@ -42,8 +42,8 @@ require 'carrierwave/orm/activerecord' | @@ -42,8 +42,8 @@ require 'carrierwave/orm/activerecord' | ||
| 42 | require 'file_size_validator' | 42 | require 'file_size_validator' |
| 43 | 43 | ||
| 44 | class User < ActiveRecord::Base | 44 | class User < ActiveRecord::Base |
| 45 | - devise :database_authenticatable, :token_authenticatable, :lockable, | ||
| 46 | - :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :registerable | 45 | + devise :database_authenticatable, :token_authenticatable, :lockable, :async, |
| 46 | + :recoverable, :rememberable, :trackable, :validatable, :omniauthable | ||
| 47 | 47 | ||
| 48 | attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, | 48 | attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, |
| 49 | :skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password, | 49 | :skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password, |
| @@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
| 1 | +Devise::Async.backend = :sidekiq |