ryanb / cancan

Authorization Gem for Ruby on Rails.
MIT License
6.28k stars 785 forks source link

Merge pull request #800 from wopata/master breaks shallow routes. #861

Open ramaboo opened 11 years ago

ramaboo commented 11 years ago

load_and_authorize_resource :dygest load_and_authorize_resource :issue, through: :dygest, shallow: true

works before pull request #800. After pull request #800 the same code returns an error: Couldn't find Dygest with id= when you visit a shallow route like /admin/issues/1/edit

The problem is line 132 of lib/cancan/controller_resource.rb which adds a .to_s call. I suspect this forcing of a string probably messes up some other check elsewhere in the system which does not expect a string to be returned when dealing with shallow routes. I don't know the cancan code base that well though so I have not investigated it further.

bryanrite commented 11 years ago

:+1: Had to revert to 1.6.9.

Possibly due to AREL now instead of meta-where?

xhoy commented 10 years ago

Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013. Since only Ryan himself has commit permissions, the CanCan project is on a standstill.

CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.

If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.

We hope to see you on the other side!