From 9552c6d97ede9022787af4ad7df731e8745e8494 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Thu, 14 Mar 2024 19:48:32 +0100 Subject: [PATCH] Do not fail when putting the gem into the Gemfile before devise itself * Just load devise in the gem first to ensure correct load order * Put gems in the "wrong" order in the tests to get them to fail when this fix is not applied. --- lib/devise/passwordless.rb | 1 + spec/dummy_app_config/Gemfile.append | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/devise/passwordless.rb b/lib/devise/passwordless.rb index 7fddc99..b1226b3 100644 --- a/lib/devise/passwordless.rb +++ b/lib/devise/passwordless.rb @@ -1,3 +1,4 @@ +require "devise" require "devise/passwordless/version" require "devise/monkeypatch" require "devise/passwordless/rails" if defined?(Rails::Engine) diff --git a/spec/dummy_app_config/Gemfile.append b/spec/dummy_app_config/Gemfile.append index 02a55d8..194223e 100644 --- a/spec/dummy_app_config/Gemfile.append +++ b/spec/dummy_app_config/Gemfile.append @@ -6,5 +6,7 @@ group :development, :test do gem 'selenium-webdriver' end -gem "devise" +# We put devise-passwordless first, to test that adding after_magic_link_sent_path_for +# to the controllers works in every order. gem "devise-passwordless", :path => "../../../" +gem "devise"