-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix backward compatible Pundit include #2383
Fix backward compatible Pundit include #2383
Conversation
3575d34
to
846cd19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if I need to update any docs.
if Pundit.const_defined?(:Authorization) | ||
include Pundit::Authorization | ||
else | ||
include Pundit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This includes was deprecated in 2.2.0: https://github.com/varvet/pundit/blob/main/CHANGELOG.md#deprecated
846cd19
to
8728917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
We appear to be having CI issues 😓 I'll merge after we solve them. |
CI should be fixed in master now. Can you try rebase, please? |
This commit fixes: thoughtbot#2378 By adding a conditional that includes Pundit::Authorization when it is defined else it includes Pundit. This change ensures that we remain compatible with Pundit < 2.2.0 To test with Pundit "~> 2.1.0", we run: ``` bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb ``` See: thoughtbot#2141 See: thoughtbot#1068
8728917
to
1a4147b
Compare
No problem, I have rebased and pushed again ✅ |
Great stuff! Thank you. |
This commit fixes #2378 By adding a conditional that includes Pundit::Authorization when it is defined else it includes Pundit.
This change ensures that we remain compatible with Pundit < 2.2.0
To test with Pundit "~> 2.1.0", we run:
See: #2141
See: #1068