class ActionDispatch::Routing::Mapper

def with_devise_exclusive_scope(new_path, new_as, options) #:nodoc:

:nodoc:
def with_devise_exclusive_scope(new_path, new_as, options) #:nodoc:
  current_scope = @scope.dup
  exclusive = { as: new_as, path: new_path, module: nil }
  exclusive.merge!(options.slice(:constraints, :defaults, :options))
  if @scope.respond_to? :new
    @scope = @scope.new exclusive
  else
    exclusive.each_pair { |key, value| @scope[key] = value }
  end
  yield
ensure
  @scope = current_scope
end