Skip to content

Commit

Permalink
Make Devise.mappings work with lazy loaded routes.
Browse files Browse the repository at this point in the history
When `Devise.mappings` is called it expects that routes are loaded because mappings is build
by `devise_for` call.
  • Loading branch information
nashby committed Nov 15, 2024
1 parent 0f514f1 commit d47b3a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ module Test
mattr_reader :mappings
@@mappings = {}

def self.mappings
Rails.application.routes_reloader.try(:execute_unless_loaded)

@@mappings
end

# OmniAuth configurations.
mattr_reader :omniauth_configs
@@omniauth_configs = {}
Expand Down

0 comments on commit d47b3a9

Please sign in to comment.