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

Upgrade pundit to latest #3237

Merged
merged 9 commits into from
Sep 27, 2023
Merged

Upgrade pundit to latest #3237

merged 9 commits into from
Sep 27, 2023

Conversation

murny
Copy link
Contributor

@murny murny commented Sep 21, 2023

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 like app/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

@murny murny marked this pull request as ready for review September 25, 2023 15:59
Copy link
Member

@pgwillia pgwillia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM! It's nice when breaking changes make things on our end more readable.

@murny murny merged commit 5c9f1a9 into master Sep 27, 2023
2 checks passed
@murny murny deleted the update-pundit-to-latest branch September 27, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants