Skip to content

Commit ffa2d23

Browse files
authored
Fix Rails 8 route lazy loading issue (#247)
1 parent 5cef13d commit ffa2d23

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/passwordless.rb

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ module Passwordless
1717
def self.context
1818
return @context if @context
1919

20+
# Routes are lazy loaded in Rails 8 so we need to load them to populate Context#resources.
21+
Rails.application.try(:reload_routes_unless_loaded)
22+
2023
LOCK.synchronize do
2124
@context ||= Context.new
2225
end

0 commit comments

Comments
 (0)