From 961df90ecdde407bdbe27e41a5f6bd6fe4bfd45c Mon Sep 17 00:00:00 2001 From: Juan Manuel Barreneche Date: Wed, 15 Sep 2010 04:27:39 +0800 Subject: [PATCH] Controllers which use 'inherit_resources' instead of Inheritance may have inherited_resource's methods protected --- lib/cancan/inherited_resource.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cancan/inherited_resource.rb b/lib/cancan/inherited_resource.rb index bcd55fb..cee940f 100644 --- a/lib/cancan/inherited_resource.rb +++ b/lib/cancan/inherited_resource.rb @@ -3,16 +3,16 @@ module CanCan class InheritedResource < ControllerResource # :nodoc: def load_resource_instance if parent? - @controller.parent + @controller.send :parent elsif new_actions.include? @params[:action].to_sym - @controller.build_resource + @controller.send :build_resource else - @controller.resource + @controller.send :resource end end def resource_base - @controller.end_of_association_chain + @controller.send :end_of_association_chain end end end