Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with ids hash not working #355

Closed
francesco-loreti opened this issue Oct 25, 2016 · 1 comment
Closed

Query with ids hash not working #355

francesco-loreti opened this issue Oct 25, 2016 · 1 comment
Labels

Comments

@francesco-loreti
Copy link

francesco-loreti commented Oct 25, 2016

Version: 1.15.0
I have two model: User and Role
In ability I can manage all User and I want manage Role

Not work if I write:
can :manage, User
can :manage, Role, user: { id: User.ids } or { id: User.pluck(:id) }

Working only if I write:
can :manage, User
users = User.all
users.each do |user|
can :manage, Role, user_id: user.id
end

This is a simple example. For more nested Models it's very difficult with many cicles inside.
Please verify and tell me the solution

@coorasse
Copy link
Member

Please refer to Stackoverflow for questions. Thanks.

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

No branches or pull requests

2 participants