No description provided.
porting #668 to 1.6.x
This doesn't make as much sense with the CanCan 1.x behavior since that Ability is intended to be focused on models and not controllers. With CanCan 2.0 using the controller name and mapping that to the model it makes sense in that release only.
@ryanb: I think the spec is incorrectly written and I'm sure it'll make more sense if it's like this:
it "should properly load resource for namespaced controller" do
project = Project.create!
@params.merge!(:controller => "admin/projects", :action => "show", :id => project.id)
resource = CanCan::ControllerResource.new(@controller)
@controller.instance_variable_get(:@project).should == project
But a similar spec is in the project already and now I am totally confused about this issue. Anyways, ignore this comment.
@ryanb: This fix is related to this issue #663.
Hey guys, I would like to reopen this PR. It is relevant to me when working with a Rails engine.
Agreed with @stas. @params[:controller] in an engine is engine_name/controller_name because it wraps the whole engine up in a routing scope.