Permalink
Browse files

Fix for deeply nested resources when using inherited resources

  • Loading branch information...
1 parent 3901cbe commit 8722fbc7a5e8101fdf3be037177761730733629c @stefanoverna stefanoverna committed Feb 17, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cancan/inherited_resource.rb
@@ -3,7 +3,8 @@ module CanCan
class InheritedResource < ControllerResource # :nodoc:
def load_resource_instance
if parent?
- @controller.send :parent
+ @controller.send :association_chain
+ @controller.instance_variable_get("@#{instance_name}")
elsif new_actions.include? @params[:action].to_sym
@controller.send :build_resource
else

0 comments on commit 8722fbc

Please sign in to comment.