Get the logic in the right order and fix variable naming (and run the tests)

This commit is contained in:
David Henry
2014-05-02 00:22:20 +01:00
parent 38b347ac00
commit e085526b6e
2 changed files with 2 additions and 2 deletions

View File

@@ -112,7 +112,7 @@ class Devise::RegistrationsController < DeviseController
# The path used after sign up for inactive accounts. You need to overwrite
# this method in your own RegistrationsController.
def after_inactive_sign_up_path_for(resource)
scope, router_name = Devise::Mapping.find_scope!(resource_or_scope, :include_router_name)
scope, router_name = Devise::Mapping.find_scope!(resource, :include_router_name)
context = router_name ? send(router_name) : self
context.respond_to?(:root_path) ? context.root_path : "/"
end

View File

@@ -43,7 +43,7 @@ module Devise
end
raise "Could not find a valid mapping for #{obj.inspect}" unless mapping
return (include_router_name ? mapping.name : [mapping.name, mapping.router_name])
return (include_router_name ? [mapping.name, mapping.router_name] : mapping.name)
end
def self.find_by_path!(path, path_type=:fullpath)