Open sbauch opened 11 years ago
@sbauch Is this still an issue?
Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still. Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994
If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)
We hope to see you on the other side!
Using rails 3.2.6, CanCan 1.6.8, and mongoid 3.05.
I have a Products collection where each Product document can be quite large.
Each user document has an array of Product IDs that the user "owns" under the :products field, and the user can manage those products.
Defined in ability.rb as
I want to load all of my products in an index action, and use the
can?
method in the view to either render a link to the show action of the product if thecurrent_user
owns it or simply the name of the product if the user does not.I want to use the mongo .only() query modifier to return only those fields that are immediately necessary. I thought that including the id would allow the
can?
method to work properly, but it does not.Does CanCan require I load the whole mongo document? I'd be happy to post more of my application code, but since it all works flawlessly without .only() I have to believe this is an isolated issue.