Controllers which use 'inherit_resources' instead of Inheritance may have inherited_resource's methods protected

This commit is contained in:
Juan Manuel Barreneche 2010-09-15 04:27:39 +08:00 committed by Ryan Bates
parent 4eee637270
commit 961df90ecd

View File

@ -3,16 +3,16 @@ module CanCan
class InheritedResource < ControllerResource # :nodoc: class InheritedResource < ControllerResource # :nodoc:
def load_resource_instance def load_resource_instance
if parent? if parent?
@controller.parent @controller.send :parent
elsif new_actions.include? @params[:action].to_sym elsif new_actions.include? @params[:action].to_sym
@controller.build_resource @controller.send :build_resource
else else
@controller.resource @controller.send :resource
end end
end end
def resource_base def resource_base
@controller.end_of_association_chain @controller.send :end_of_association_chain
end end
end end
end end