fix(STI): compress rules per subjects #855
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi 👋
This is a follow-up PR for the changes of: #843
I updated cancancan to its latest version earlier today and noticed that some of our authorization specs were failing. It was related with the latest changes of compressing duplicate rules in combination with STI subjects. I provided a spec to reproduce the issue and a solution as well, which will modify
seen
inlib/cancan/rules_compressor.rb
to keep track of seen rules per given subjects. This solution works for our app.As a chore I uppercased a changelog entry body to fix a spec.
I added a missing changelog entry for 3.6.1. Please note that 3.6.1 is already released at Rubygems, but there is no tag at this repo.
Let me know if I need to do anything else to get this PR merged 🙏