Fix for deeply nested resources when using inherited resources
This commit is contained in:
parent
3901cbe499
commit
8722fbc7a5
|
@ -3,7 +3,8 @@ module CanCan
|
||||||
class InheritedResource < ControllerResource # :nodoc:
|
class InheritedResource < ControllerResource # :nodoc:
|
||||||
def load_resource_instance
|
def load_resource_instance
|
||||||
if parent?
|
if parent?
|
||||||
@controller.send :parent
|
@controller.send :association_chain
|
||||||
|
@controller.instance_variable_get("@#{instance_name}")
|
||||||
elsif new_actions.include? @params[:action].to_sym
|
elsif new_actions.include? @params[:action].to_sym
|
||||||
@controller.send :build_resource
|
@controller.send :build_resource
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user