Permalink
Browse files

Use collection instead of end_of_association_chain in the inherited_r…

…esources integration, as per suggested by aq1018
  • Loading branch information...
1 parent 79995e4 commit e3eab13b860ad6e21d7d5ab4a6f7e85827e87979 @tanordheim tanordheim 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 e3eab13

Please sign in to comment.