allow :through option to work with private controller methods - closes #360

This commit is contained in:
Ryan Bates 2011-05-17 13:18:31 -04:00
parent cb9777be5f
commit dde88c92b7

View File

@ -178,7 +178,7 @@ module CanCan
def fetch_parent(name)
if @controller.instance_variable_defined? "@#{name}"
@controller.instance_variable_get("@#{name}")
elsif @controller.respond_to? name
elsif @controller.respond_to?(name, true)
@controller.send(name)
end
end