Permalink
Browse files

Merge branch 'inherited_resources_collection_fix' of https://github.c…

…om/tanordheim/cancan into tanordheim-inherited_resources_collection_fix
  • Loading branch information...
2 parents bcf2756 + e3eab13 commit 28a9a0ac074918b58a5404e156431574a1e0f67f @ryanb committed Mar 8, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/cancan/inherited_resource.rb
  2. +2 −2 spec/cancan/inherited_resource_spec.rb
@@ -12,7 +12,7 @@ def load_resource_instance
end
def resource_base
- @controller.send :end_of_association_chain
+ @controller.send :collection
end
end
end
@@ -32,10 +32,10 @@
@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

0 comments on commit 28a9a0a

Please sign in to comment.