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
Initial attributes rewrite loaded parent relation #472
Comments
Please write a gist to reproduce the issue. https://gist.github.com/coorasse/3f00f536563249125a37e15a1652648c |
Hi, I analysed your gist and the definition of the abilities was the issue. If you define the abilities like that:
the tests pass. Please feel free to re-open providing another non-working test. Thank you! |
I know that you can pass an array, but this is not an explicit behavior, therefore a ticket was created |
Will there also be proposals to transfer an array? reopen issue pls |
If I have a rule related to the parent resource, I have something that the value of the rule erases the realation with the parent resource
My rules:
Controller code:
I have two objects with ids 1 and 2, at the time of build the resource, the correct reference to the parent is first specified, but it is replaced by the initial attributes, which according to the created rules will be:
cancancan/lib/cancan/ability.rb
Lines 188 to 196 in e88a267
cancancan/lib/cancan/controller_resource_builder.rb
Lines 9 to 22 in 8fc2a2d
Perhaps it is worth not to consider the initial attribute if it has already been set?
The text was updated successfully, but these errors were encountered: