class Devise::Mapping

def self.find_scope!(obj)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.find_scope!: (Symbol obj) -> untyped

This signature was generated using 1 sample from 1 application.

raises an error. If a symbol is given, it's considered to be the scope.
Receives an object and find a scope for it. If a scope cannot be found,
def self.find_scope!(obj)
  obj = obj.devise_scope if obj.respond_to?(:devise_scope)
  case obj
  when String, Symbol
    return obj.to_sym
  when Class
    Devise.mappings.each_value { |m| return m.name if obj <= m.to }
  else
    Devise.mappings.each_value { |m| return m.name if obj.is_a?(m.to) }
  end
  raise "Could not find a valid mapping for #{obj.inspect}"
end