From e3d55fbbfa3d0e74f967b1669ecf974f0c67df0b Mon Sep 17 00:00:00 2001 From: Torsten Date: Tue, 24 Jan 2023 19:04:53 +0200 Subject: [PATCH] add devise async and suckerpunch --- Gemfile | 3 +++ Gemfile.lock | 7 +++++++ app/models/member.rb | 2 +- config/initializers/devise.rb | 1 + config/initializers/sucker_punch.rb | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 config/initializers/sucker_punch.rb diff --git a/Gemfile b/Gemfile index 3e950f5..5dd813e 100644 --- a/Gemfile +++ b/Gemfile @@ -27,6 +27,7 @@ gem "simple_form" , "5.1.0" gem "simple_form_tailwind_css" gem 'kaminari' gem 'ransack' +gem "devise-async" gem "passenger" , "6.0.15" , require: "phusion_passenger/rack_handler" gem "bootsnap", require: false @@ -52,3 +53,5 @@ group :test do end gem "pundit", "~> 2.3" + +gem "sucker_punch", "~> 3.1" diff --git a/Gemfile.lock b/Gemfile.lock index 99efdb2..aaab7fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -137,6 +137,9 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) + devise-async (1.0.0) + activejob (>= 5.0) + devise (>= 4.0) erubi (1.12.0) erubis (2.7.0) execjs (2.8.1) @@ -363,6 +366,8 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) ssrf_filter (1.1.1) + sucker_punch (3.1.0) + concurrent-ruby (~> 1.0) tailwindcss-rails (2.0.21-x86_64-linux) railties (>= 6.0.0) temple (0.10.0) @@ -421,6 +426,7 @@ DEPENDENCIES carrierwave (>= 3.0.0.beta, < 4.0) debug devise + devise-async guard guard-minitest haml-rails @@ -441,6 +447,7 @@ DEPENDENCIES simple_form_tailwind_css sprockets (= 4.1.1) sprockets-rails + sucker_punch (~> 3.1) tailwindcss-rails thredded (~> 1.0) web-console diff --git a/app/models/member.rb b/app/models/member.rb index 4c73a86..3b19e35 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -2,7 +2,7 @@ class Member < ApplicationRecord # Include default devise modules. Others available are: # , :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable,:confirmable, - :recoverable, :rememberable, :validatable + :recoverable, :rememberable, :validatable, :async mount_uploader :picture, PictureUploader has_many :stories diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a4247b2..5747dc3 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -309,3 +309,4 @@ Devise.setup do |config| # changed. Defaults to true, so a user is signed in automatically after changing a password. # config.sign_in_after_change_password = true end +Devise::Async.backend = :sucker_punch diff --git a/config/initializers/sucker_punch.rb b/config/initializers/sucker_punch.rb new file mode 100644 index 0000000..755f0e8 --- /dev/null +++ b/config/initializers/sucker_punch.rb @@ -0,0 +1 @@ +require 'sucker_punch/async_syntax'