From f7ef23e41210a43d75fe3255562792be3636f849 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 9 Oct 2013 15:25:31 +0300 Subject: [PATCH 1/2] Send devise emails async --- Gemfile | 1 + Gemfile.lock | 3 +++ app/models/user.rb | 4 ++-- config/initializers/devise_async.rb | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 config/initializers/devise_async.rb diff --git a/Gemfile b/Gemfile index fb67f301f72..a5ac9acc8b2 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem "pg", group: :postgres # Auth gem "devise", '~> 2.2' +gem "devise-async" gem 'omniauth', "~> 1.1.3" gem 'omniauth-google-oauth2' gem 'omniauth-twitter' diff --git a/Gemfile.lock b/Gemfile.lock index ce3aeb7994b..667ea9f1299 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,6 +106,8 @@ GEM orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) + devise-async (0.8.0) + devise (>= 2.2, < 3.2) diff-lcs (1.2.4) dotenv (0.8.0) email_spec (1.4.0) @@ -564,6 +566,7 @@ DEPENDENCIES d3_rails (~> 3.1.4) database_cleaner devise (~> 2.2) + devise-async email_spec enumerize factory_girl_rails diff --git a/app/models/user.rb b/app/models/user.rb index 5d742578c42..4d46efe42de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -42,8 +42,8 @@ require 'carrierwave/orm/activerecord' require 'file_size_validator' class User < ActiveRecord::Base - devise :database_authenticatable, :token_authenticatable, :lockable, - :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :registerable + devise :database_authenticatable, :token_authenticatable, :lockable, :async, + :recoverable, :rememberable, :trackable, :validatable, :omniauthable attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, :skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password, diff --git a/config/initializers/devise_async.rb b/config/initializers/devise_async.rb new file mode 100644 index 00000000000..05a1852cdbd --- /dev/null +++ b/config/initializers/devise_async.rb @@ -0,0 +1 @@ +Devise::Async.backend = :sidekiq From 92768844cf894fda2d0eb50555a78b19d00f0ce8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 9 Oct 2013 13:52:03 +0000 Subject: [PATCH 2/2] Reverted accidently removed registration module --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 4d46efe42de..29c53b88331 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -43,7 +43,7 @@ require 'file_size_validator' class User < ActiveRecord::Base devise :database_authenticatable, :token_authenticatable, :lockable, :async, - :recoverable, :rememberable, :trackable, :validatable, :omniauthable + :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :registerable attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, :skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password, @@ -398,4 +398,4 @@ class User < ActiveRecord::Base self end -end +end \ No newline at end of file