Use collection instead of end_of_association_chain in the inherited_resources integration, as per suggested by aq1018
This commit is contained in:
parent
79995e4309
commit
e3eab13b86
@ -12,7 +12,7 @@ module CanCan
|
||||
end
|
||||
|
||||
def resource_base
|
||||
@controller.send :end_of_association_chain
|
||||
@controller.send :collection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -32,10 +32,10 @@ describe CanCan::InheritedResource do
|
||||
@controller.instance_variable_get(:@project).should == :project_resource
|
||||
end
|
||||
|
||||
it "index should load through @controller.end_of_association_chain" do
|
||||
it "index should load through @controller.collection" do
|
||||
@params[:action] = "index"
|
||||
stub(Project).accessible_by(@ability, :index) { :projects }
|
||||
stub(@controller).end_of_association_chain { Project }
|
||||
stub(@controller).collection { Project }
|
||||
CanCan::InheritedResource.new(@controller).load_resource
|
||||
@controller.instance_variable_get(:@projects).should == :projects
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user