Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

1.6.10 breaks load_and_authorize_resource of parent resource #865

Closed
plindelauf opened this issue May 10, 2013 · 5 comments
Closed

1.6.10 breaks load_and_authorize_resource of parent resource #865

plindelauf opened this issue May 10, 2013 · 5 comments

Comments

@plindelauf
Copy link

Version 1.6.10 fails to successfully load the parent resource, in case of nested resources. E.g. on my users_controller, I have:

load_and_authorize_resource :company
load_and_authorize_resource :user, :through => :company, :shallow => true

This will result in an error 404 on all actions with a shallow path. I dug into cancan a little and found that in load_resource_instance on line 69, the find_resource resulted in the exception #<ActiveRecord::RecordNotFound: Couldn't find Company with id=> when I called the users_controller with http://localhost:3000/users/3/edit.

Version 1.6.9 works fine, so I reverted to that.

@mhenrixon
Copy link

👍 have the exact same problem

@swobspace
Copy link

Same problem here with poymorphic style like

  load_resource :applic
  load_resource :vote
  load_and_authorize_resource :anlage, :through => [:applic, :vote]

Version 1.6.9 works fine.

@koukou73gr
Copy link

#861 duplicate?

@plindelauf
Copy link
Author

@koukou73gr You're right. I'm sorry. Looking forward to 1.6.11.

@javinto
Copy link

javinto commented May 14, 2013

Glad to see I'm not the only one. There is definitely something wrong with this version when using nested resources.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants