diff --git a/lib/devise/mapping.rb b/lib/devise/mapping.rb index 8b1f94ced..cb4a2316e 100644 --- a/lib/devise/mapping.rb +++ b/lib/devise/mapping.rb @@ -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.try(:reload_routes_unless_loaded) obj = obj.devise_scope if obj.respond_to?(:devise_scope) + case obj when String, Symbol return obj.to_sym