Skip to content

Commit

Permalink
Make test helpers work for deferred routes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedalbert committed Aug 16, 2024
1 parent a259ff3 commit d809745
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/devise/mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class Mapping #:nodoc:
# Receives an object and finds a scope for it. If a scope cannot be found,
# raises an error. If a symbol is given, it's considered to be the scope.
def self.find_scope!(obj)
Rails.application.routes_reloader.try(:execute_unless_loaded)
obj = obj.devise_scope if obj.respond_to?(:devise_scope)

case obj
when String, Symbol
return obj.to_sym
Expand Down

0 comments on commit d809745

Please sign in to comment.