lib/devise/mapping.rb in devise-0.7.5 vs lib/devise/mapping.rb in devise-0.8.0

- old
+ new

@@ -27,10 +27,10 @@ # Loop through all mappings looking for a map that matches with the requested # path (ie /users/sign_in). If a path prefix is given, it's taken into account. def self.find_by_path(path) Devise.mappings.each_value do |mapping| route = path.split("/")[mapping.as_position] - return mapping if mapping.as == route.to_sym + return mapping if route && mapping.as == route.to_sym end nil end # Find a mapping by a given class. It takes into account single table inheritance as well.