class Devise::Mapping
def self.find_by_path!(path, path_type = :fullpath)
def self.find_by_path!(path, path_type = :fullpath) Devise.mappings.each_value { |m| return m if path.include?(m.send(path_type)) } raise "Could not find a valid mapping for path #{path.inspect}" end