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.
Context
Bump Pundit from v1.1.0 to v2.3.1
The big breaking change with this upgrade was due to this: varvet/pundit#529
Previously with a namespace authorize like
authorize [:admin, @user]
which we do lots for our Admin policies likeapp/policies/admin/user_policy.rb
the "record" would be an array containing[:admin, @user]
. Now after v2.0.0 of pundit, it's the last element of the array. So the "record" is now@user
in our example.This is what we expected anyway, we just manually did
record.last
in places. But now we can just drop the.last
call everywhere.Cleaned up any places we were doing this. Everything appears to be working now.
Related to #965